<script> down = 0; onmousedown = function(){down = 1;} onmousemove = function(){down ? alert(true) : 0;} onmouseup = function(){down = 0;} </script>