How to change a JQuery Mobile button icon with javascript

后端 未结 3 739
谎友^
谎友^ 2021-01-14 20:43

I would like to have a button that changes data-icon class depending upon user selections

Example button would be:



        
3条回答
  •  隐瞒了意图╮
    2021-01-14 21:08

    Just pass in the value to the data function. See the documentation

    $("#language2").data("icon", "another-flag");
    

提交回复
热议问题