-
Notifications
You must be signed in to change notification settings - Fork 1
/
form.js
26 lines (24 loc) · 806 Bytes
/
form.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
document.addEventListener('DOMContentLoaded',function (){
let button = document.querySelector('#Submit_button');
let returnbutton = document.querySelector('#return_homepage');
returnbutton.style.visibility = "hidden"
button.addEventListener('click',function (){
let name = document.querySelector('#nameinput').value;
let email = document.querySelector('#emailinput').value;
let state = document.querySelector('#state').value
if(name == ""){
alert("Enter Your name")
return 0;
}
if(email == ""){
alert("Enter Your email")
return 0;
}
if(state == ""){
alert("Enter Your state")
return 0;
}
document.querySelector('#feedback1').innerHTML = "Your details have been saved"
returnbutton.style.visibility = "visible"
})
})