Open Means Open Means

function checkNumber(aNumber) {

if (aNumber > 0 && aNumber < 100) {

////////////////////////////////////////////////////

// If the number is greater than 0 and less than

// 100, pop up a “congratulations” message and return

// a value indicating success.

////////////////////////////////////////////////////

alert(“The number you specified is valid (it is between 0 and 100).”)

return true

}

////////////////////////////////////////////////////////

// Otherwise, the number is negative or over 100,

// so return a value indicating failure.

////////////////////////////////////////////////////////

else {

alert(“The number you specified is invalid (not between 0 and 100).

\nPlease try again.”)

return false

}

}

...

...

Please type in a number:

...

onClick=”checkNumber(document.myForm.inputNumber.value);”>

 

No comments

Login to post a comment

Show
  • Create an account
  • Forgot your username?
  • Forgot your password?
  • About Us
  • Faqs
  • Contact Us
  • Disclaimer
  • Terms & Conditions