-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnav.js
42 lines (42 loc) · 1.13 KB
/
nav.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const hamburger= document.querySelector('#toggle');
const x = document.querySelector('#cross');
const menu = document.querySelector('#media-menu');
const inp = document.querySelectorAll("form label");
function enable(){
menu.classList.remove('remove');
}
function disable(){
menu.classList.add('remove');
}
hamburger.addEventListener('click',enable);
cross.addEventListener('click',disable);
/*for form */
inp[0].addEventListener('click',function(){
if(inp[0].value==""){
inp[0].classList.remove('pop-up');
}
else{
inp[0].classList.add('pop-up');
}
});inp[1].addEventListener('click',function(){
if(inp[1].value==""){
inp[1].classList.remove('pop-up');
}
else{
inp[1].classList.add('pop-up');
}
});inp[2].addEventListener('click',function(){
if(inp[2].value==""){
inp[2].classList.remove('pop-up');
}
else{
inp[2].classList.add('pop-up');
}
});inp[3].addEventListener('click',function(){
if(inp[3].value==""){
inp[3].classList.remove('pop-up');
}
else{
inp[3].classList.add('pop-up');
}
});