This is what I have to represent the text box and the slider:
<input id="rangeInputM" type="range" min="-10" max="10" oninput="m1.value=rangeInputM.value" />
<input id="m1" type="number" value="1" min="-200" max="200" oninput="rangeInputM.value=m1.value" />
I know how to keep track of user input into the text box:
$("#m1").keyup(function(){
var m1,b1 = 0;
m1 = parseFloat($("#m1").val());
b1 = parseFloat($("#b1").val());
var myGraph = new Graph({
canvasId: 'Graph',
minX: -10,
minY: -10,
maxX: 10,
maxY: 10,
unitsPerTick: 1
});
myGraph.drawLine(m1, b1, 'blue', 3);
});
But I do not know how to do the same thing to the range slider to keep track of that value. This link is if you want to test the entire code: https://jsfiddle.net/csCoder/eLxfrn10/9/