老师帮看一下 我的按钮 “是”跳转图片不成功
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body{
background-image: url(img/bjsky.jpg);
background-repeat:no-repeat ;
background-size: 1600px 800px;
}
a{
font-size: 25px;
color: #ffffff;
}
.div1{
width: 300px;
height: 200px;
background-color: gray;
text-align: center;
}
input{
width: 40px;
height: 30px;
}
</style>
<script>
var i=-1;
function changebc(){
var arr=['bjsky.jpg','mayun.jpg','simple.jpg','sxt.jpg','zgc.jpg'];
if(i<arr.length-1){
i++;
}else{
i=0;
}
document.body.style.backgroundImage="url(img/"+arr[i]+")"
}
function chengove(){
//获得div对象
var div = document.getElementById("div_1");
div.style.marginTop=Math.random()*500+"px";
div.style.marginLeft=Math.random()*800+"px";
}
function changeclk(){
document.body.style.backgroundImage="url(img/1.jpg)";
//设置当前div隐藏
document.getElementById("div_1").style.display="none";
}
</script>
</head>
<body>
< a href="javascript:changebc()">点击更换主题</ a>
<div class="div1" id="div_1">
<h3>我是不是你的小可爱</h3>
<input type="button" value="是" onclick="changeclk" />
<input type="button" value="否" onmouseover="chengove()"/>
</div>
</body>
</html>