update(s)


  
  function update () {
  f=document.getElementById('fv').value;
    p = []
    with (Math) 
      for (var x = -a; x < a+.1; x += .1)
        // p[p.length] = [x, x-x*x*x]
        //p[p.length] = [x, eval(f)]
        p[p.length] = [x, cube(x)]
    stroke = xstroke()
    //path(p,"func")
    //stroke = "blue"
    plot(f,-a,a)
    setText(f,"fval")
    setText(a.toFixed(2),"aval")
    setText((-a).toFixed(2),"maval")
  }
  </script>
  <h5>
  y=<span id="fval">f</span>
  <input type="text" id="fv" name="fname" value="cube(x)" onblur="toggle()" />
  for <span id="maval">a <=x<= a</span>
  <input type="button" value="-" onclick="a-=.25;update()"/>
  <input type="button" value="+" onclick="a+=.25;update()"/>
  </h5>
  </center>
  </body>