title: Using eval to calculate a function?
body: <p>Trying to make a JS calculator, and I'm having a hard time getting through the eval part. </p>
  
  <p>My HTML looks a little something like this (not literal):<br>
  <code>&lt;map name="Map"&gt;<br>
    &lt;area shape="rect" coords="11,11,11,11" href="#" onClick=calculatenumber(7)&gt;<br>
    &lt;area shape="rect" coords="11,11,11,11" href="#" onClick=calculatenumber(8)&gt;<br>
    &lt;area shape="rect" coords="11,11,11,11" href="#" onClick="calculatenumber(' / ')"&gt;<br>
    &lt;area shape="rect" coords="11,11,11,11" href="#" onClick="calculateresult()"&gt;<br>
  &lt;/map&gt;</code></p>
  
  <p>My JS looks like this:<br>
  <code>function calculatenumber(value){document.getElementById('mydiv').innerHTML += value;}</code>  </p>
  
  <p><code>function calculateresult(){document.getElementById('mydiv').innerHTML = eval(calculatenumber());}</code>  </p>
  
  <p>When entered, I get undefined as an answer. It would seem that my two functions are not interacting. How would I go about fixing this? </p>