日期:2014-05-16 浏览次数:20450 次
<body>
<div id = "a">ab</div>
<div id = "b">ba</div>
</body>
<script>
function change(){
var a = document.getElementById("a"),
b = document.getElementById("b");
if(a.style.display == "block"){
a.style.display = "none";
b.style.display = "block";
}else{
b.style.display = "none";
a.style.display = "block";
}
setTimeout(change,10*1000);
}
change();
</script>