Week 2 - 122v1.htm

<SCRIPT>

// \( tells us to escape the opening parenthesis - this avoids the confusion
// is this beginning of a function or method for example
var myColor = prompt("Enter Color \(Red/Blue/Green\) :", "blue");

var mySentence = prompt("Enter a sentence", "Let's see what happens!");

document.fgColor = myColor;

document.write("<B>" + mySentence + "</B>");

</SCRIPT>

NOTE: What we really wanted was just the sentence's color changed, not the entire document's foreground color.