22 lines
605 B
JavaScript
22 lines
605 B
JavaScript
{6ed4f2f7cf7b6408fc962e99a3cedbb8ea05eeda true 605 main.js 0xc0030cae00}
(function(){
|
|
const form = document.querySelector('#message-form');
|
|
|
|
form.addEventListener('submit', function(e){
|
|
e.preventDefault()
|
|
|
|
const message = document.querySelector('#message');
|
|
const feedback = document.querySelector('.feedback');
|
|
const messageContent = document.querySelector('.message-content');
|
|
|
|
if(message.value === ''){
|
|
feedback.classList.add('show');
|
|
setTimeout(function(){
|
|
feedback.classList.remove('show')
|
|
}, 4000)
|
|
} else{
|
|
messageContent.textContent = message.value;
|
|
message.value = ''
|
|
}
|
|
})
|
|
})()
|