I see there supposed to be new function in jQuery Mobile 1.3.0 which we can change button theme dynamically from JavaScript: http://jquerymobile.com/blog/2013/02/20/jquery-mobile-1-3-0-released/
But when I try to run following code, I got error message in my console. It says "no method '_setOption'", so I started to guess if it is really implemented or not.
Is this new function really implemented? If so, that would be appreciated if let me know how to use it from JavaScript. Thanks.
(HTML)
<a id="btn1" data-role="button" data-theme="e" onClick="clk();">XXX</a>
(JavaScript)
function clk(){
var $btn = $('#btn1');
$btn._setOption('data-theme', 'b');
}
(Console)
Uncaught TypeError: Object [object Object] has no method '_setOption'
You are using incorrect function, you should use this one:
$( "a" ).buttonMarkup({ theme: "c" });
Official documentation: http://api.jquerymobile.com/button/#option-theme
Live jsFiddle example: http://jsfiddle.net/Gajotres/eqLVV/