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