Jquery Click or Press and Hold


I have a task of building a button that a user can click or press and hold.

Basically it would act like a telegraph machine.

If the user presses and holds it should fire an event.

If the user clicks on the button it should fire another event.

Any ideas where to start?

Many thanks,


jQuery bind() is what your seeking, you can set multiple events to it and then have the event do something


For what your wanting you would use

    $('#id-here').bind('click mousedown', function(){
        // Do something here