浏览器在运行代码的时候提示错误Uncaught TypeError: Cannot read property 'style' of null,
请各位大神帮我一下!!<HTML><HEAD><TITLE>颜色块移动</TITLE><SCRIPTLANGUAGE="javascript">functionmove(...
请各位大神帮我一下!!
<HTML>
<HEAD>
<TITLE>颜色块移动</TITLE>
<SCRIPT LANGUAGE="javascript">
function move(){
/* **********Found********** */
var toy = document.getElementById("toy");
/* **********Found********** */
toy.style.left = parseInt(10)+"px";
}
/* **********Found********** */
var id = window.setInterval(move(), 1000);
/* **********Found********** */
window.clearInterval(function(){
/* **********Found********** */
toy.style.position(id);
}, 10000);
</SCRIPT>
</HEAD>
<BODY>
<div id="toy" style="width:30px;
height:30px;
/* **********Found********** */
background-color:#ff0000;
position:absolute;left:20px">
</div>
<BODY onLoad="javaScript:move()">
</BODY>
</HTML> 展开
<HTML>
<HEAD>
<TITLE>颜色块移动</TITLE>
<SCRIPT LANGUAGE="javascript">
function move(){
/* **********Found********** */
var toy = document.getElementById("toy");
/* **********Found********** */
toy.style.left = parseInt(10)+"px";
}
/* **********Found********** */
var id = window.setInterval(move(), 1000);
/* **********Found********** */
window.clearInterval(function(){
/* **********Found********** */
toy.style.position(id);
}, 10000);
</SCRIPT>
</HEAD>
<BODY>
<div id="toy" style="width:30px;
height:30px;
/* **********Found********** */
background-color:#ff0000;
position:absolute;left:20px">
</div>
<BODY onLoad="javaScript:move()">
</BODY>
</HTML> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询