望采纳。
<td id="mytd"></td><昌铅script type="耐让好text/javascript"滑枣>
var tddom= document.getElementById('mytd')
var timer = null
tddom.onmousedown = function(){
timer = setTimeout( doStuff, 2000 )//这里设置时间
}
tddom.onmouseup = function(){
clearTimeout( timer )
}
function doStuff() {
alert('hello, you just pressed the td for two seconds.')
}
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)