Get the selected element of a drop-down list with JavaScript

the_math-hobbyist shared this question 9 months ago
Answered

Hi.

Could I get the selected element of a drop-down list only with JavaScript? (I mean: as in the attached applet, without have to create the text object selectedOption) Is it possible?

Comments (2)

photo
1

I tried with:

var option = ggbApplet.evalCommand("SelectedElement(lst)");

However I got a True value for the option variable, and a new (and unwanted) text object.

photo
2

Make an object index=SelectedElement(lst) then use ggbApplet.getValue("index")

© 2020 International GeoGebra Institute