Javascript examples for DOM HTML Element:Input Password
Check Password from input type password
<html> <head></head> <body> Password:/*from w w w . ja va2 s. com*/ <br> <input type="password" id="password"> <button onclick="myFunction()">Submit</button> <p id="login"></p> <script> function myFunction() { password = document.getElementById("password").value; if(password == '12345'){ document.getElementById("login").innerHTML = "Success!"; }else{ document.getElementById("login").innerHTML = "Wrong password!"; } } </script> </body> </html>