title: eval() fails to evaluate innerHTML
body: <p>I have following code structure</p>
  
  <pre><code>&lt;script&gt;  
  function load_script()
  {
    eval( document.getElementById("mydiv").innerHTML );
  }
  &lt;/script&gt;
  
  &lt;div id="mydiv"&gt;function sum(a,b){return a+b;}&lt;/div&gt;
  
  &lt;input type="button" onclick="load_script()" value="Load Script"&gt;
  
  &lt;input type='button' value = 'Get Sum' onclick='sum(1,2)'&gt;
  </code></pre>
  
  <p>When I click on 'Load Script' button to run <code>load_script()</code> function, the <code>innerHTML</code> is not parsed by <code>eval()</code> and as a result, the 'Get Sum' button always fails. Why is it like this?</p>