Java Player Java Player - 7 months ago 84
jQuery Question

how to set HTML attribute values in runtime using javaScript?

I want to make a theme Switcher.

My idea is to make a div class with many anchor elements (the themes) containing a

data-theme
attribute which contains different swatches (
a
,
b
,
c
,
d
,
e
). I want to replace the
data-theme
attribute of every page with the
data-theme
selected when the user clicks a link. How can I make that using JavaScript?

Answer Source

Like I do green says jquerymobile has the theme roller working.

But I think that a change isn't necessary because you can set a swatch let's say -a and then in every theme change you only have to replace the css, so this way it's not necessary to modify the HTML DOM...

Good Luck!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download