エレメントを表示する、非表示にする

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/prototype.js" charset="shift_jis"></script>
<script type="text/javascript"><!--
Event.observe(window, "load", function(){
Event.observe($("toggleButton"), "click", function(){
$("content").toggle();
}, false);
Event.observe($("showButton"), "click", function(){
$("content").show();
}, false);
Event.observe($("hideButton"), "click", function(){
$("content").hide();
}, false);
}, false);
// --></script>
</head>
<body>
<h1>エレメントの表示/非表示</h1>
<div id="content">Prototype Library</div>
<form action="./dummy.cgi">
<input type="button" value="トグル" id="toggleButton">
<input type="button" value="表示" id="showButton">
<input type="button" value="非表示" id="hideButton">
</form>
</body>
</html>
サンプルを実行
[戻る]
prototype.jsパーフェクトリファレンス説明などは本書を参考にしてください。