html - JavaScript function doesn't run on click -
although know lot these languages such arrays , functions, i'm having basic problem getting javascript run, here's code:
<!doctype html> <html> <head> </head> <body> <input type="submit" value="submit" onclick="click()" /> <script> function click() { alert("hey"); } </script> </body> </html>
you're running problem: javascript function name cannot set click?
you can fix changing function name else function myclick
<head> </head> <body> <input type="submit" value="submit" onclick="myclick()" /> <script> function myclick() { alert("hey"); } </script> </body> </html>
Comments
Post a Comment