Wondering if you can help me out. I seem to have a problem changing the text of my jQuery Mobile buttons with jQuery.
$(\"#myButton .ui-btn-text\").text(\"New te
With jquery.mobile-1.1.0 I was experiencing something slightly different and had trouble sifting through the responses to find a workable answer. I've documented the problems I experienced and the solution I found below.
Snippet 1
With this, I'm able to change the text, but the method clears out the added spans and classes, thus compressing the button.
HTML
Snippet 2
This had no effect upon the button text.
HTML
Snippet 3
This generated the following error message:
cannot call methods on button prior to initialization; attempted to call method 'refresh'
Which was confusing to me because this function is being called only after the page is initialized. Reading further, I then noticed Priyank's reference to a working answer at stackoverflow.com/a/7279843/61821
Snippet 4 - Working
A better jQuery selector works like a charm.