javascript - Can't get html to check value -
i having webpage value of textbox , check value of "bypass". if stuff in textbox equals value of "bypass", website redirect google. doesn't work, if put in correct values.
my code this:
<!doctype html> <head> <title>aca2</title> </head> <body> <center> <form> <p><input type="password" name="pass"><br></p> <p><button onclick="bypasscheck()">...</button></p> </form> <p><a href="index.html">back</a></p> </center> <script type="text/javascript"> function bypasscheck() { var aaa = document.getelementbyname('pass')[0].value var bbb = "bypass"; if(aaa == bbb) { window.location.assign("www.google.com") } } </script> </body> </html>
use document.getelementsbyname , window.open("https://www.google.co.in/") proper https url. if provide www.google.co.in won't redirected google.
below working code:
<!doctype html> <head> <title>aca2</title> </head> <body> <center> <form> <p><input type="password" name="pass"><br></p> <p><button onclick="bypasscheck()">...</button></p> </form> <p><a href="index.html">back</a></p> </center> <script type="text/javascript"> function bypasscheck() { var aaa = document.getelementsbyname('pass')[0].value var bbb = "bypass"; if(aaa == bbb) { window.open("https://www.google.co.in/") } } </script> </body> </html>
Comments
Post a Comment