Reputation: 385
I'm working in Jquery Mobile, and I've got a page which has a back button with this attribute:
data-add-back-btn="true"
I need to be able to change the text of it dynamically through either jquery or javascript. I've googled it quite a bit but not much luck.
Upvotes: 0
Views: 404
Reputation: 24738
$(document).on("pageinit", "#page2", function(){
$("a[data-rel=back] .ui-btn-text").html('my text');
});
In jQM markup added for the back button, you select a span with class ui-btn-text that is the child of an A tag with data-rel=back, and then change its html.
Upvotes: 2