-2

In jQuery mobile how does one dynamically change the theme of a hyperlink within a controlgroup. I have the id of the hyperlink but can not find a way of doing this.... I tried:

var ohyper= $("#myid");
ohyper.a({theme: 'b'});

I've Answer my own question.

The following piece of code will dynamically change any hyperlink's theme within a controlgroup in jquery mobile.

$( "#"+myid ).controlgroup({theme: 'b'});

I hope this will help anyone else with a similar question.

ShuklaSannidhya
  • 8,572
  • 9
  • 32
  • 45

1 Answers1

1

The correct way of changing the theme would be as follows:

$(this).buttonMarkup({theme: 'b'});

http://jsfiddle.net/ouadie/HuWgs/
Maybe this is usefull to you: change jquery mobile color swatch dynamically

Community
  • 1
  • 1
Ouadie
  • 13,005
  • 4
  • 52
  • 62
  • I tried that on my hyperlink id within the controlgroup and it did not work. then i tried my solution and that worked... – user2330664 Apr 29 '13 at 07:47
  • can you put your code in `jsfiddle.net` ? and see this http://jsfiddle.net/ouadie/HuWgs/ it works – Ouadie Apr 29 '13 at 07:58