交作业,顺便问一下有没有大佬知道哪个js命令是清空gb()所做的修改的
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>style样式</title>
<script type="text/javascript">
function gb(){
var gb = document.getElementById("con");
gb.style.color="red";
gb.style.backgroundColor="#CCC";
}
function hd(){
var gb = document.getElementById("con");
gb.style.display="none";
}
function sh(){
var gb = document.getElementById("con");
gb.style.display="block";
}
</script>
</head>
<body>
<h2 id="con">I love JavaScript</H2>
<p id="txt"> JavaScript使网页显示动态效果并实现与用户交互功能。</p>
<input type="button" value="换色" onclick="gb()" />
<input type="button" value="隐藏" onclick="hd()" />
<input type="button" value="显示" onclick="sh()" />
</body>
</html>