I was having a similar trying to update the data theme to some custom-built themes based on certain events.
Started out setting the data-theme attribute but this only refreshed the first couple times and then stopped: var myButton = document.getElementById('myButton'); myButton.setAttribute('data-theme', 'k');
When I examined the button with Firebug, the class of the button was being added to every time I changed themes, so that there was a long list of classes. I think this was causing the issues. class = "ui-btn ui-btn-corner-all ui-shadow ui-btn-up-a ui-btn-up-e ui-btn-up-j ui-btn-up-k"
So, I also set the class attribute each time and everything seemed to refresh fine: myButton.setAttribute('class', 'ui-btn ui-btn-corner-all ui-shadow ui-btn-up-k');
Note: I found that you have to do both...set the data-theme and class.
I seem to have found a way to get jquery to refresh the class by specifically calling for pageshow event after I make adjustments to the HTML. Not sure if this is the most efficient way to do it as it does seem a refresh option is needed but it works for me.