Jump to content

If Else statement


EnzoDerek
 Share

Recommended Posts

Does any1 know how to throw an if else statement on a button like this:<head><script type="text/javascript">function disp_alert(){alert("I am an alert box!!")}</script></head><body><form><input type="button" onclick="disp_alert()" value="Display alert box"></form></body>????????????????????????????????????PLEASE HELP ME!!!

Link to comment
Share on other sites

<head><script type="text/javascript">function disp_alert(){     if(somecondition)     {           //do something     }     else     {          //do something else     }}</script></head><body><form><input type="button" onclick="disp_alert()" value="Display alert box"></form></body>

Is this what you want?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...