Javascript DOM ondblclick Event via HTML Tag ondblclick attribute

Introduction

This example demonstrates how to assign an "ondblclick" event to a p element.

View in separate window

<!DOCTYPE html>
<html>
<body>
<p id="demo" ondblclick="myFunction()">Double-click me.</p>
<script>
function myFunction() {/*from   www  . j  ava  2s .  c om*/
  document.getElementById("demo").innerHTML = "I was double-clicked!";
}
</script>

</body>
</html>
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>.



PreviousNext

Related