jQuery mobile change the text value of a input button

966 views Asked by At

I just started using jQuery version 1.9.1 and now I am unable to change the text value of a jQuery mobile button. In my JSFiddle demo i have tried every possible way to change the value with no luck.

When I was using jQuery version 1.8.2 paired with jQuery Mobile version 1.2.0 the following code worked just fine to change the text value of a button.

$('#btnSubmit').prev('.ui-btn-inner').children('.ui-btn-text').html('test');

Does anyone know how to accomplish this with the newer version of jQuery?

JSFiddle Demo

1

There are 1 answers

0
ezanker On BEST ANSWER

Change the val() of the button and then tell the jQM to refresh the button widget

$("#btnSubmit").val('test').button( "refresh" );

Updated FIDDLE