August 1999
Intermediate to advanced
1488 pages
72h 53m
English
if(statement){ code; }
The if statement is used to perform logic statements on specific cases. If statement evaluates to true, code is executed.
In Listing 6.143, you see how the if statement is being used to determine if the temp Boolean value is true.
<html>
<body>
<script lanuguage="JavaScript">
<!–– Hide
var temp = 1;
if(temp == true){
document.write("Statement is true");
}
// End Hide –– >
</script>
</body>
</html>
|
Read now
Unlock full access