如何从 JavaScript 将 data-theme
值添加到所有 div、listview、forms、li、ul 等?
是否可以?如果是,我该怎么做?
像下面这样的东西会起作用吗?
$.mobile.page.prototype.options.contentTheme= "e";
最佳答案
Array.prototype.forEach.call(document.getElementsByTagName("*"), function (el) {
el.setAttribute("data-theme", "e");
});
关于javascript - 将数据主题添加到所有项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12420657/