<title>显示和隐藏图片</title> <script type="text/javascript"> function hidden_b2(){ document.getElementById("b2").style.visibility="hidden"; } function none_b2(){ document.getElementById("b2").style.display="none"; } </script> </head> <body> <img src="images/book1.jpg" alt="book1" id="b1" /> <img src="images/book2.jpg" alt="book2" id="b2" /> <img src="images/book3.jpg" alt="book3" id="b3" /><br /> <input name="btn1" type="button" value="visibility隐藏图b2" onclick="hidden_b2()" /> <input name="btn2" type="button" value="display隐藏图b2" onclick="none_b2()" /> </body>