<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>style样式</title>
</head>
<body>
<h2 id="con">I love JavaScript</H2>
<p> JavaScript使网页显示动态效果并实现与用户交互功能。</p>
<script type="text/javascript">
var mycon = document.getElementById("con");
mycon.style.color = "red";
mycon.style.backgroundColor = "#CCC";
function hidden(){
mycon.style.display = "none";
}
</script>
<input type="button" value="隐藏h2" onclick="hidden()"/>
</body>
</html>
//hideen这个函数名和关键字hidden冲突了,改下函数名就可以了
function hidden() {
}