这样做好不好?(能运行)总感觉哪里怪怪的,求各位大佬指点
<!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 marry=document.getElementById("con");
marry.style.color="red";
marry.style.backgroundColor="#CCC";
function myapp(){
marry.style.display="none";
}
function myapp1(){
marry.style.display="block";
}
</script>
<input type="button" value="隐藏" onclick="myapp()"/>
<input type="button" value="显示" onclick="myapp1()"/>
</body>
</html>