This code now works.
You had a missing } at the end of your script and you need == instead of just = when you compare to variables and I took out the ; after your if conditions.
You should also include a <title> and <head> as othjers have stated
Code:
<html>
<body>
<pre>
<script type="text/javascript">
// initalizing the values of three variables
var red = "X";
var blue = "O";
var green = "X";
// Per the statements below, check first for three X's
// If the criteria isn't met, move onto three O's
// If neither condition is met, display "Cat's game"
if ((red=="X")&&(blue="X")&&(green=="X")) {
window.document.writeln('X wins!');
} else {
if ((red=="O")&&(blue=="O")&&(green=="O")) {
window.document.writeln('O wins!');
} else {
window.document.writeln("Cat's game!");
}
}
</script>
</pre>
</body>
</html>
Bookmarks