Hi!
I’m trying to produce a graph of y = mx+5 where m is gathered from user inputted data. I have the axes laid out before the (and won’t copy and paste them here because its fine), but when I run my program and input a number it shows the graph for a mili second and then it disappears. Does anyone know how to fix this?
Here is my code:
<font face="Baskerville">Input a value for m:</font><br>
<input type="number" name="m" Id="m"><br>
<button onclick="sqr();, doSubmit();">Graph Me!</button><br>
</form>
<script type="text/javascript">
function sqr()
{
var D = document.getElementById('m').value;
myGraph.drawEquation(function(x) {
return (D * x) + 5;
}, 'green', 3);
}