4

Is it possible to disable the ondblclick event?

3 Answers 3

7
document.ondblclick = function() { return false; }

...or if you didn't want to do it site-wide.

document.getElementById('something').ondblclick = function() { return false; }
Sign up to request clarification or add additional context in comments.

Comments

0

You can use:

event.preventDefault();
event.stopPropagation(); 
event.stopImmediatePropagation();

Comments

-1
<script type="text/javascript">
document.ondblclick = function DoubleClick(evt) {
    if (window.getSelection)
        window.getSelection().removeAllRanges();
    else if (document.selection)
        document.selection.empty();
}
</script>

This code will disable selecting text via double click

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.