After you have installed the theme on the button, you need to call "update" on it, as shown below ...
$("#next").attr("data-theme","a").button('refresh');
If you want to associate this type of behavior with all the βnextβ buttons in the process, and there may be more than one, you might consider making something more like this. He will check each page for a button that has a colorChangeButton class, and then, when clicked, changes the theme to an alternative theme that is specified in this button attribute for the theme "Topic Theme".
<a href="#" data-role="button" class="colorChangeButton" data-theme-pressed="a" data-theme="b">Next</a> <script type='text/javascript'> $('div').live('pageinit', function(){ $("a.colorChangeButton).click(function(){ var $thisButton = $(this); $thisButton.attr("data-theme",$thisButton.attr("data-theme-pressed")).button('refresh'); }); }); </script>
source share