<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>显示和隐藏display属性</title>
<script type="text/javascript">
function hedetext=()
{var char=document.getElementById("con").style.display="none";}
function showtext()
{var char=document.getElementById("con").style.display="block";}
</script>
</head>
<body>
<h1>JavaScript</h1>
<p id="con">做为一个Web开发师来说,如果你想提供漂亮的网页、令用户满意的上网体验,JavaScript是必不可少的工具。</p>
<input type="button" onclick="hidetext()" value="隐藏内容">
<input type="button" onclick="showtext()" value="显示内容">
</body>
</html>
function hedetext=() // 这句应该是function hidetext()
不用赋值给变量,直接运行就行; function hedetext=()
{document.getElementById("con").style.display="none";}