title: Why is this JavaScript floor math code returning nan?
body: <pre><code>var num = Math.floor(document.getElementById("num").innerHTML);
  document.getElementById("num").innerHTML = num+1;
  }
  else{
  document.getElementById("num").innerHTML = num-1;
  }
  </code></pre>
  
  <p>I get $NaN, unfortunately!</p>
  
  <p>The contents of the span is <code>&lt;span id="num"&gt;0&lt;/span&gt;</code>, you know, nothing special, and I must be doing something stupid so I'm utterly confused!</p>
  
  <p>Thank ye.</p>