Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11726 closed bug (invalid)

Changing button's data-theme programatically

Reported by: Radek Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:


I am changing data-theme for a button dynamically from JS.


  1. I have a button with theme "e"
  2. I change it to "a" via $btn.attr("data-theme", "e")
  3. The button is still displayed in yellow, with the previous "e" theme

After that, I noticed the the generating <div> around the button contained both ui-btn-hover-e and ui-btn-up-e and their -a variants. It is also in case when I'm updating data-theme for the div.

So the workaround for me is to also remove the previous classes from the generated div:

$btn.closest("div").attr("data-theme", "e").removeClass("ui-btn-hover-a").removeClass("ui-btn-up-a");

Change History (1)

comment:1 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

You'd want to file a bug in the jQuery Mobile issue tracker, per the big red box here that says "ARE YOU IN THE RIGHT PLACE?" http://bugs.jquery.com

Note: See TracTickets for help on using tickets.