1.classjs Դ?码分????
2.js里怎么将 document.getElementById 改成调用 class 类的名称
classjs Դ?????
你要表达的意思应该是:那个JS里边调用了id='good'这个元素吧,下载一些文本编辑器比如notepad++,码分源码标准打开你的码分源码11111000HTML文件目录,按ctrl+shift+f,码分redissession源码全局查找document.getElementById("good")或者$("#good"),码分jmap源码正则表达式为document.getElementById(['"]?码分csock源码good['"]?)或$(['"]?#good['"]?)
js里怎么将 document.getElementById 改成调用 class 类的名称
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
RunJS 演示代码
</title>
<script type="text/javascript">
function test(obj) {
if (obj.id == "Radio1") {
document.querySelector(".Div1").style.display = "block";
document.querySelector(".Div2").style.display = "none";
}
if (obj.id == "Radio2") {
document.querySelector(".Div1").style.display = "none";
document.querySelector(".Div2").style.display = "block";
}
}
</script>
</head>
<body>
<input type="button" id="Radio1" onclick="test(this)" value="我" />
<input id="Radio2" type="button" onclick="test(this)" value="你" />
<div class="Div1" style="display:none;">
aaaa
</div>
<div class="Div2" style="display:none;">
bbbb
</div>
</body>
</html>