1.classjs Դ?码分????
2.js里怎么将 document.getElementById 改成调用 class 类的名称
classjs Դ?????
你要表达的意思应该是:那个JS里边调用了id='good'这个元素吧,下载一些文本编辑器比如notepad++,码分幸运28 app 源码打开你的码分充话费平台源码HTML文件目录,按ctrl+shift+f,码分个人导航源码简洁全局查找document.getElementById("good")或者$("#good"),码分45的源码补码正则表达式为document.getElementById(['"]?码分联联游源码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>