请问如何隐藏图片呢?
代码如下:
JS:
function hidepic(){
var mychar = document.getElementById("con");
mychar.style.diplay="none";
}
function showpic(){
var mychar = document.getElementById("con");
mychar.style.display="block";
}
HTML:
<div class="main2">
<div id="con" ><h1>My Photo</h1>
<div class="img"><img src="http://www.huangxiaolong.net/wp-content/uploads/2015/07/psb.jpg" height="657px" width="370"></div><br/>
He is ugly.<input type="button" onClick="hidepic" value="Click disappear" />
Is cool.<input type="button" onClick="showpic" value="Look again" />
</div></div>