SHOW:
|
|
- or go back to the newest paste.
| 1 | <html> | |
| 2 | <head> | |
| 3 | <script type="text/javascript"> | |
| 4 | - | function checkForm(number) |
| 4 | + | function checkForm() |
| 5 | {
| |
| 6 | var number=document.getElementById("button").value
| |
| 7 | var numTrue=true | |
| 8 | try | |
| 9 | {
| |
| 10 | number+1 | |
| 11 | } | |
| 12 | catch(err) | |
| 13 | {
| |
| 14 | numTrue=false | |
| 15 | } | |
| 16 | if (numTrue) | |
| 17 | - | alert("You entered "+number+" secsessfully."
|
| 17 | + | |
| 18 | alert("You entered "+number+" succssessfully.")
| |
| 19 | } | |
| 20 | else | |
| 21 | {
| |
| 22 | alert(number+" is not a number, fool.") | |
| 23 | } | |
| 24 | } | |
| 25 | </script> | |
| 26 | </head> | |
| 27 | <body> | |
| 28 | <form name="myform"> | |
| 29 | - | <input type="button" name="button" onclick="checkForm(this.form)" |
| 29 | + | |
| 30 | <input type="button" name="button" id="button" onclick="checkForm()" | |
| 31 | </form> | |
| 32 | </body> | |
| 33 | </html> |