Check out the MDN definition of the DOM event ondblclick
here.
Here is a working example jsFiddle from referencing that definition.
jQuery was only used in this example to run the initialization event in jsFiddle, you could put it in the body onLoad
handler like they show on the MDN reference page.
Basically, you get the element that you want to handle the double click event for, and assign either a user-defined function, or an anonymous function to run when that event occurs. You do not absolutely need jQuery for this, but it is a perfect example of how jQuery can make things easier for you when it comes to handling events from DOM objects.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.3.js'></script>
<link rel="stylesheet" type="text/css" href="/css/result-light.css">
<style type='text/css'>
</style>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$(function(){
initElement();
});
function initElement()
{
var p = document.getElementById("foo");
// NOTE: showAlert(); or showAlert(param); will NOT work here.
// Must be a reference to a function name, not a function call.
p.ondblclick = showAlert;
};
function showAlert()
{
alert("ondblclick Event detected!")
}
});//]]>
</script>
</head>
<body>
<span id="foo">My Event Element</span>
<p>double-click on the above element.</p>
</body>
</html>