+ 1
window.onload=function(){ document.getElementById('field').addEventListener("input",hideText); function hideText(){ document.getElementsByClassName('email_placeholder')[0].style.display="none"; document.getElementsByClassName('pass_placeholder')[0].style.display="none"; } }
17th May 2020, 3:11 PM
Abhay
Abhay - avatar
+ 1
it was ClassName ,also it was email not mail and also it was ElementsbyClassName not Element since it is use to get an array of classes with same name so you need to use [0] to tell the index of which class you are talking about so I hope you have a clear understanding of why I included indexes about window.onload it stops the JavaScript to get loaded before html ,try removing it and you will see some errors
17th May 2020, 3:14 PM
Abhay
Abhay - avatar
+ 1
Then you have to add two different input functions with different id or class name ,here you are using just one input for both with same id ,
17th May 2020, 3:19 PM
Abhay
Abhay - avatar
+ 1
I already told about window.onload function ,if you wanna remove you can ,but js might get loaded before html and it will give errors since JavaScript will try to get the elements which doesn't exist yet
17th May 2020, 3:28 PM
Abhay
Abhay - avatar
+ 1
wrong class name ,check the spelling of email ,also ElementsbyClassName means it returns an array you need to specify which class you wanna get from it ,use indexing for that as I already told above
17th May 2020, 6:26 PM
Abhay
Abhay - avatar
0
You are saying it isn't a placeholder of that input box as it is ,so why should it disappear ,it's just a div with text in input box
17th May 2020, 2:39 PM
Abhay
Abhay - avatar
0
I don't see any display:none ,maybe you forgot to add JavaScript
17th May 2020, 2:48 PM
Abhay
Abhay - avatar
0
i dont see
18th May 2020, 9:42 PM
Wynter Jones
Wynter Jones - avatar
0
no
18th May 2020, 9:42 PM
Wynter Jones
Wynter Jones - avatar
0
hi
18th May 2020, 9:42 PM
Wynter Jones
Wynter Jones - avatar