Posted on Leave a comment

Update button text in JQuery Mobile

jQuery Logo

In case you wondered how it is possible to update the text of a <button> element created by markup in jQuery mobile (i.e. not a button generated using <a data-type=”button”>) you need to set the text and then call refresh on the node:

$('#someButton').text("Updated text");

refresh() actually causes the node to be reloaded, thus reflecting your changes.