<!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" />
<style>
#div1{width:640px; height:853px; display:none;}
#div2{width:640px;height:853px; display:block;}
</style>
<script>
function change(){
var x=document.getElementById("div1");
var y=document.getElementById("div2");
if(x.style.display=="none"){
x.style.display="none;"
y.style.display="block;"}
else{
x.style.display="block;"
y.style.display="none;"
}
}
</script>
<title>JS之路(二)</title>
</head>
<body>
<input type="button" value="点击" onmouseclick="change();"/>
<div id="div1" >
<img src="2014-10-22.jpeg" />
</div>
<div id="div2">
<img src="2014-10-22(1).jpeg" />
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
#div1{width:640px; height:853px; display:none;}
#div2{width:640px;height:853px; display:block;}
</style>
<script>
function change(){
var x=document.getElementById("div1");
var y=document.getElementById("div2");
if(x.style.display=="none"){
x.style.display="none;"
y.style.display="block;"}
else{
x.style.display="block;"
y.style.display="none;"
}
}
</script>
<title>JS之路(二)</title>
</head>
<body>
<input type="button" value="点击" onmouseclick="change();"/>
<div id="div1" >
<img src="2014-10-22.jpeg" />
</div>
<div id="div2">
<img src="2014-10-22(1).jpeg" />
</div>
</body>
</html>