Home  >  jQuery

Example of .dblclick() in jQuery

April 29, 2013
.dblclick() binds an event with double click equivalent to java script. .dblclick() is a jQuery function that can be used with any DOM element. Synatx is
.dblclick()
 
Find the example.

<!DOCTYPE html>
<html>
<head>
<style>
div { background:yellow; cursor:pointer }
div.dbclk { background:blue; }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<div>Double Click me to test dblclick() </div>
<script>
$("div").dblclick(function () {
$("div").toggleClass('dbclk');
});
</script>
</body>
</html>
 

Output
FIND MORE TUTORILAS






©2019 concretepage.com | Privacy Policy | Contact Us