This is driving me crazy. I cannot figure out why I get "mytest is not defined" error:
here's the fiddle --> http://jsfiddle.net/y7MTs/5/
HTML:
<span>One: </span>
  <input type='text' id='ax' value='4' size='6'/>
  <br/>
<span>Two: </span>
  <input type='text' id='bx' value='2.5' size='6'/>
  <br/><br/>
<button onclick='mytest(ax.value, bx.value);'>Go Now</button>
Javascript:
function mytest(a, b) {
  var x = [0, 1, 2, 3, 4, 5];
  var y = [100, 120, 140, 160, 180, 200];
  var myval = parseFloat(a) - x[3];
  alert(myval);    
}
 
    