Why am I having problems with setInterval?
<p>I'm a novice javascript programmer and I always have trouble with the <code>setInterval</code>. W3Schools makes it look so easy but I can never get it to work when i need to. Here I have a span I want to make 'flash'.</p>

<pre><code>var id = window.setInterval(function(){
             if($("#span1").css("color") == "red"){
                 $("#span1").css("color","blue");
             }
             else{
                 $("#span1").css("color","red");}
         }, 100);
</code></pre>

<p>I keep getting a <code>SYNTAX ERROR: Unexpected token ILLEGAL</code>. What am I doing wrong here?</p>

<p>NOTE: I know there's some jQuery method that could handle this easily. I'm trying to gain a better understanding of this JS function.</p>

<p><strong>UPDATE</strong> I fixed the syntax error. (Missing quotation). Now I get an error <code>undefined</code>.</p>
