Chris
Chris

Reputation: 13

How do I get the value entered in an "Input box" to be assigned to a variable?

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

Answers (1)

Atharva Sharma
Atharva Sharma

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

Related Questions