The text comes from the label and you are changing the actual button
You are replacing the HTML inside of the button
JQuery Mobile adds classes and other elements - this is what JQuery Mobile defines as "Enhancements". So an element can be enhanced by JQuery Mobile.
Number 3 is the reason it worked the other way, you can make the change before JQuery Mobile enhances the button. Go to a browser and inspect a radio button, it's not simple after it's been enhanced. If you change it then you are in trouble. You are removing classes and <spans>