I would like to have a button that changes data-icon class depending upon user selections
Example button would be:
Just pass in the value to the data function. See the documentation
$("#language2").data("icon", "another-flag");