js点击按扭替换图片
<scripttype="text/javascript">window.onload=function(){document.getElementById("one")...
<script type="text/javascript">
window.onload = function () {
document.getElementById("one").onclick = function () {
var bb = document.getElementById("mg");
bb.src = "d:\document_x64\pictures\1.jpg"
}
}
</script>
</head>
<body>
<input type="button" id="one" value="换图">
<img src="d:\document_x64\pictures\0.jpg" id="mg">
</body>
请问语法有没问题?为什么点击按扭没有反映? 展开
window.onload = function () {
document.getElementById("one").onclick = function () {
var bb = document.getElementById("mg");
bb.src = "d:\document_x64\pictures\1.jpg"
}
}
</script>
</head>
<body>
<input type="button" id="one" value="换图">
<img src="d:\document_x64\pictures\0.jpg" id="mg">
</body>
请问语法有没问题?为什么点击按扭没有反映? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询