我正在尝试使用超时功能为3秒的JavaScript标签在图像上放置一个链接,
js代码
var img = new Image();
img.src = 'http://test.com/cdb/smail_images/TVSmilesLogo.jpg';
img.onclick = function() {
window.location.href = 'http://test.com/';
};
document.body.appendChild(img);而html文件代码是
<script src="t.js" type="text/javascript"></script>https://stackoverflow.com/questions/41392887
复制相似问题