title: Get id as a number in javascript..?
body: <p>A simple question..</p>
  
  <pre><code>var x = document.getElementById('xNum');
  var y = document.getElementById('xNum');
  var result = x * y;
  
  document.write(result);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;div id="xNum"&gt;20&lt;/div&gt;
  &lt;div id="yNum"&gt;50&lt;/div&gt;
  </code></pre>
  
  <p>It displays 20 and 50. why not calculating 20 * 50? Why does it get as a integer or how can I get numbers in an div?</p>
  
  <p>Thanx!</p>
  
  <p>I don't get any result with that:</p>
  
  <pre><code>var x = document.getElementById('xNum').innerHTML;
  var y = document.getElementById('xNum').innerHTML;
  var result = parseInt(x) * parseInt(y);
  
  document.write(result);
  </code></pre>