<script type = "text/javascript">
var number1=50;
var number2= 30;
If (number1<number2)
{
alert ("That's the right answer, pro!");
}
< /script >
If else statements:
<script type = "text/javascript">
var number1=50;
var number2= 30;
If (number1<number2)
{
alert ("That's the right answer, pro!");
}
else
{
alert ("Try again!");
}
< /script >
If else else statements:
<script type = "text/javascript">
var name=randy;
If (name=randy)
{
alert ("That's the right answer, pro!");
}
else if ( name= rendy)
{
alert ( "Spell again!);
}
else
{
alert ("Try again!");
}
< /script >