<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>display</title> <script type="text/javascript"> var i=0; function hidetext(){ i++; if(i%2!=0){
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>display</title>
<script type="text/javascript">
var i=0;
function hidetext(){
i++;
if(i%2!=0){
hide();
}
else{
showtext();
}
function hide()
{
var mychar = document.getElementById("con");
mychar.style.display='none';
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display='block';
}
}
</script>
<style type="text/css" >
body{
background:#eee;
}
form{
background:#fff;
}
input{
background:#fff;
}
p{background:#fff;
margin-top:0px;
}
</style>
</head>
<body>
<form>
<input type="button" onclick="hidetext()" value="不会了怎么办?" />
</form>
<p id="con">做为一个Web开发师来说,如果你想提供漂亮的网页、令用户满意的上网体验,JavaScript是必不可少的工具。</p>
</body>
</html>