Reputation: 13
I have created an input box on a JSXGraph and I can type into the box. In the context, the user will enter a number. How do I assign the entered value to a variable so that I can then do a calculation with it?
Upvotes: 1
Views: 153
Reputation: 315
You can simply use .Value() function to get the value entered in an input like:
var input = board.create('input', [0, 1, 'sin(x)*x', 'f(x)='], {cssStyle: 'width: 100px'});
var result = input.Value();
Upvotes: 1