ondblclick = myFunction(); - Javascript DOM Event

Javascript examples for DOM Event:Element Event Attribute

Description

The ondblclick event occurs when the user double-clicks on an element.

Summary

Bubbles Yes
Cancelable Yes
Event type: MouseEvent
Supported HTML tags: All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo">Double-click me.</p>

<script>
document.getElementById("demo").ondblclick = function() {myFunction()};

function myFunction() {/*from  ww w. j a va2  s  .c o m*/
    document.getElementById("demo").innerHTML = "I was double-clicked!";
}
</script>

</body>
</html>

Related Tutorials