How can I add the data-theme
value to all divs, listviews, forms, li, ul etc. from JavaScript?
Is it possible? If yes how can I do that?
Will something like the following work?
$.mobile.page.prototype.options.contentTheme= "e";
How can I add the data-theme
value to all divs, listviews, forms, li, ul etc. from JavaScript?
Is it possible? If yes how can I do that?
Will something like the following work?
$.mobile.page.prototype.options.contentTheme= "e";
Array.prototype.forEach.call(document.getElementsByTagName("*"), function (el) {
el.setAttribute("data-theme", "e");
});
If you have jquery-mobile included, following should work:
$.mobile.page.prototype.options.contentTheme= "e";
$.mobile.page.prototype.options.headerTheme= "e";
$.mobile.page.prototype.options.footerTheme= "e";
However if you added any elements that are not part of header, content or footer, then you should go with Domenic's way of applying for every element