VineetDubey Posted June 19, 2011 Share Posted June 19, 2011 <html> <head> <script> function do() { window.location.href="http://www.google.co.in/"; } </script> </head> <body> <h3>i am test page</h3> <input type='submit' onClick='do()' /> </body> </html> Quote Link to comment Share on other sites More sharing options...
VineetDubey Posted June 19, 2011 Author Share Posted June 19, 2011 <html> <head> <script> function do() { window.location.href="http://www.google.co.in/"; } </script> </head> <body> <h3>i am test page</h3> <input type='submit' onClick='do()' /> </body> </html> This code is not working please anyone can help me to sort this out Quote Link to comment Share on other sites More sharing options...
efficacious Posted June 19, 2011 Share Posted June 19, 2011 <html> <head> <script> function do() { window.location.href="http://www.google.co.in/"; } </script> </head> <body> <h3>i am test page</h3> <input type='button' onclick='do()' value='CLICK ME!' /> </body> </html> Quote Link to comment Share on other sites More sharing options...
Adam Posted June 19, 2011 Share Posted June 19, 2011 'do' is a reserved name in JavaScript - look into 'do .. while' loops. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.