小智 5
当然,你可以添加CSS规则:
body {
text-transform: uppercase;
}
Run Code Online (Sandbox Code Playgroud)
@DominatorX根据你的回答,你可以尝试这样的事情:
var allDomElems = $('body *'),
helper;
allDomElems.each(function () {
helper = $(this).text();
helper = helper.toUpperCase();
if($(this).children().length === 0) {
$(this).text(helper);
}
});
Run Code Online (Sandbox Code Playgroud)
这并不适用于所有情况,因此您必须调试脚本.