望采纳。
<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>