The if Statement
Assuming boolean variable isWhite:
if ( isWhite ) {
document.bgColor = "pink";
isWhite = false;
} else {
document.bgColor = "white";
isWhite = true;
}
The else block is optional, of course
Previous slide
Next slide
Back to first slide
View graphic version