Ajay Rawat
Ajay Rawat

Reputation: 59

disable double click on body tag

I'm trying to disable double click on body. i try given below code but it is not working.

$("*").dblclick(function (e) {
        e.stopPropagation();
        e.preventDefault();
        return false;
    }); 

Upvotes: 0

Views: 9688

Answers (2)

S. S. Rawat
S. S. Rawat

Reputation: 6111

$(document).dblclick(function (e) {
    e.preventDefault();
}); 

Upvotes: 1

GautamD31
GautamD31

Reputation: 28763

Try like

$("body").dblclick(function (e) {
    e.preventDefault();
}); 

Or even try like

$('body').bind('dblclick',function(e){
    e.preventDefault();
});

Upvotes: 4

Related Questions