how to implement mousemove while mouseDown pressed js

I have to implement mouse move event only when mouse down is pressed. I need to execute “OK Moved” only when mouse down and mouse move. I used this code $(“.floor”).mousedown(function() { $(“….


This is my updated and modified script, it works completely, except I would like to universalize it… observe the **** how can I make it so that I don’t have to do function(e){BOX.Draggable.elemen = || e.srcElement; elementDraggable(e); everytime I need to use the dragable function for a different element? Answer Is jQuery an option for you? It makes what you are doing really simple since the code already exists. Demo JavaScript Code