javascript 缺少对象 请求高手帮助
<html>
<head>
<title>鼠标离入离出切换图片</title>
<script type="text/javascript">
function MouseIn(imgUrl) {
document.getElementById("MyImg").src = imgUrl;
}
function MouseOut(imgUrl) {
document.getElementById("MyImg").src = imgUrl;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img alt="" id="MyImg" src="Images/1.jpg" width="200px;" height="200px;" onmouseover="MouserIn('Images/2.jpg')" onmouseout="MouserOut('Images/1.jpg')"/>
</div>
</form>
</body>
</html>
//本人是当学javascript,所以不太懂,请各位高手帮忙解答,不知道这个哪里错了
------解决方案--------------------
JScript codefunction MouseIn(imgUrl) { document.getElementById("MyImg").src = imgUrl; } function MouseOut(imgUrl) { document.getElementById("MyImg").src = imgUrl; }
------解决方案--------------------
你js中定义的函数名是MouseIn和MouseOut
而你在html中调用的是MouserIn和MouserOut
查询谷 - www.chaxungu.com
javascript 缺少对象 请求高手帮助解决思路
编辑:chaxungu时间:2022-10-02 23:23:53分类:web开发