<!--if statement (executes code when a specified condition is set up.) )
if (condition)
{
Execute code when conditions are set
}-->
<script type= "Text/javascript" >
var d = ' www.111cn.net ';
if (d = = ' www.111cn.net ')
{
document.write ("<b> This is a good station, worth collecting!" </b> ")
}
</script>
<!--if...else statement (executes code when the specified condition is set up, executing additional code when the condition is not valid)
if (condition)
{
Execute this code when the condition is set
}
Else
{
Execute this code when the condition is not true
}
You can use the If....else statement if you want to execute a piece of code when the condition is set up and execute another piece of code when the condition is not tenable.
-->
<script type= "Text/javascript" >
var d = ' a ';
if (d = = ' A ')
{
document.write ("<b> everyone Good </b>")
}
Else
{
document.write ("<b> Welcome to a www.111cn.net</b>")
}
</script>
<!--If.. else If...else statement (use this statement to optionally execute one of several block codes.) )
if (condition 1)
{
Condition 10% Execute code immediately
}
else if (condition 2)
{
Condition 20% Execute code immediately
}
Else
{
Execute code when both condition 1 and Condition 2 are not true
}
When you need to select a set of multiple sets of code to run, use the If....else if...else statement
-->
<script type= "Text/javascript" >
var time = ' 111cn.net ';
if (time.length<10)
{
document.write ("<b> Too Short </b>")
}
else if (time.length>=10 && time.length<16)
{
document.write ("<b> Good station AH,www.111cn.net</b>")
}
Else
{
document.write ("<b> come again next time, this site updated every day!</b>")
}
</script>