Javascript DOM ondblclick Event

Introduction

Execute a JavaScript when a <p> element is double-clicked:

View in separate window

<!DOCTYPE html>
<html>
<body>
<p ondblclick="myFunction()">Double-click this paragraph to trigger a function.</p>
<p id="demo"></p>
<script>
function myFunction() {//from   w  w  w .j  av  a  2  s.  c o m
  document.getElementById("demo").innerHTML = "Hello World";
}
</script>

</body>
</html>

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

Bubbles:
Cancelable:
Event type:
Supported HTML tags:












Yes
Yes
MouseEvent
All HTML elements,
EXCEPT:
<base>,
<bdo>,
<br>,
<head>,
<html>,
<iframe>,
<meta>,
<param>,
<script>,
<style>, and
<title>.



PreviousNext

Related