Look into the val() (http://api.jquery.com/val/) method. For submit buttons, this will change the text displayed on the button. For other types of input (such as text, password), it will change what has been typed into it. For radio buttons or checkboxes, it will change what value is sent to the server upon submission.
It is important to understand what the html("") function is doing... This is changing what html content is INSIDE the selector. Since "input" is a self closing tag (at least in xhtml), it does not matter what you put in html() for "input", since it will not be visible to the user.
This does not work... I thought, I have to use .val()?
Very interesting: Doing this:
The alert() shows me first ".", that is the default value in the HTML. Then I set a new value and read this value. The alert shows me "new value", so this seems to be okay, but the input type="submit" does not display this value on the webpage.
I am having this same issue. I have successfully changed the value of the button in the DOM but it doesn't change the physical buttons text. I have even tried traversal to get inside the DOM created span to change the the text inside the span with a class of ui=btn-text that is a child of a span with a class of ui-btn-inner which believe is all created by query mobile. When we applied that library is when I found my button change stopped happening.
Leave a comment on grindnmosh's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic