I would like to have a button that changes data-icon class depending upon user selections
Example button would be:
<a href="#language2" data-rel="popup" data-role="button"
data-icon="english-flag" data-inline="true"
data-position-to="origin">
<span id="language3">English</span>
</a>
I'd like to know what javascript code I would need to implement in order to change the custom defined data-icon="english-flag" to be instead data-icon="another-flag"
Thanks in advance.
Edit: The answer to my followup questions below on how to specify which button to affect can be found at; How to change a specific JQuery Mobile button icon with javascript