views:

33

answers:

1

Hi

I'm learning Javascript. I noticed that if I click on an object multiple times, quickly, some clicks are captured as double clicks. Is it possible to capture all clicks in Javascript as single clicks only?

Thanks

+1  A: 

Using jQuery, you could create a double click event handler on the document and then prevent that default behavior:

$(document).dblclick(function(e) {
    e.preventDefault();
    alert('Handler for .dblclick() called and ignored.');
});

Double click in the example to see the result.

Pat
I would like to learn Javascript without any libraries first.
fatcatz