Properties
Category
English
Similar Topics
Statistics
Comments
1
Participants
1
Subscribers
0
Votes
1
Views
1856
Share
Answered
Is it possible for a JavaScript function to get the value of a text object?
For example,
GeoGebraScript:
- mytext = "pizza"
Followed by JavaScript:
- alert(ggbApplet.getValue("mytext"));
And this would result in a popup that says "pizza". This doesn't work because the getValue() command only returns a number which is NaN for text objects and there is no getTextValue function.
- GeoGebra
- Help
- Partners
-
Contact us
- Feedback & Questions
- This email address is being protected from spambots. You need JavaScript enabled to view it.
- +43 677 6137 2693
© 2022 International GeoGebra Institute
I found the answer to my own question. It's not obvious, so here it is for anyone else searching for this.
Use:
The trick is that getValueString() returns some sort of pointer so you have to add a string to it like +"" to actually get the string value.
Comments have been locked on this page!