| Author |
JavaScript to get and update the 'value' of a text field?
|
Toni Howlett
Greenhorn
Joined: Jan 18, 2012
Posts: 25
|
|
I plan to have multiple instances of the code above, and next to each, a button that says up, and another that says down. My goal is to have it when these are clicked, it will change the order in an array I have, but I need the value of the textfield to change as well so the user knows what order they are in.
With that said, all I need to know is that is there a simple way to get it and change it?
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
Give the element an id, then:
You can get the reference other ways, but getting it by id is the least fragile and surest way.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Toni Howlett
Greenhorn
Joined: Jan 18, 2012
Posts: 25
|
|
Awesome, thanks!
Simple and just what I needed.
|
 |
 |
|
|
subject: JavaScript to get and update the 'value' of a text field?
|
|
|