noobzilla
noobzilla

Reputation: 1155

A simple If...else block. Why is it doing nothing?

 <html>
    <head></head>
    <body>
     <script type = "text/javascript">
      var x = 5;
      var y = 8;
      if (x < 6)
      {
       document.write("They are equal");
      }
      else
      {
       document.write{"They are NOT equal");
      }
     </script>
    </body>
</html>

Upvotes: 0

Views: 264

Answers (1)

ChaosPandion
ChaosPandion

Reputation: 78282

I think you have a syntax error:

document.write{"They are NOT equal");

Should be

document.write("They are NOT equal");

Upvotes: 12

Related Questions