Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 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";
}
}
+ 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
+ 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 ,
+ 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
+ 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
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
0
I don't see any display:none ,maybe you forgot to add JavaScript
0
i dont see
0
no
0
hi