August 16, 2009

Javascript Tutorial 7: If Statement

var num1=5;
var num2=10;

if (num1>num2)
alert ("message that you want to put");

Now check how it comes up with the number that you have defined to the variable. You can also play around with them by changing the order of the greater than statement. If you make the statement false, no popup will come up, it will remain as a blank page.

Technorati Tags: ,

No comments:

Post a Comment