|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
new at javascript...having trouble
Ok, so this is the script...why won't it post the message?
<html> <head> <script language="javascript"> function goforit() { var number1, number2, product; number1 = parseInt(document.lab.number.value); number2 = parseInt(document.lab.digits.value); product = number1 * number2 if (product>40) { document.lab.message.value = "Product is greater than 40"; } if (product<40) { document.lab.message.value = "Product is less than 40"; } } </script> </head> <body> <form name="lab"> Number <input name="number" type = "text" size = "6"><br> Digits <input name="digits" type = "text" size = "6"><br> <input type="button" value="Go for it" on click="goforit()"><br> Message <input name="message" type = "text" size = "50"><br> </form> </body> </html> |
|
#2
|
||||
|
||||
|
Because the event handler "onclick" is written as one word - you have a space in yours.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > new at javascript...having trouble |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|