日期:2014-05-16 浏览次数:20386 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>显示隐藏图片</title> <script type="text/javascript"> function none_b2(){ document.getElementById("b2").style.display="none"; } function block_b2(){ document.getElementById("b2").style.display="block"; /* document.getElementById("b2").style.float="left"; */ } </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="btn2" type="button" value="display隐藏图片b2" onclick="none_b2()" /> <input name="btn4" type="button" value="display显示图片b2" onclick="block_b2()" /> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>显示隐藏图片</title> <script type="text/javascript"> function none_b2(){ document.getElementById("b2").style.display="none"; } function block_b2(){ document.getElementById("b2").style.display="inline"; /* document.getElementById("b2").style.float="left"; */ } </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="btn2" type="button" value="display隐藏图片b2" onclick="none_b2()" /> <input name="btn4" type="button" value="display显示图片b2" onclick="block_b2()" /> </body> </html>
------解决方案--------------------