In this article we will learn how JQuery double click events work
Example 1: Show Alert on double click of paragraph, using JQuery Event (Live Demo)
I have a simple html para, whose id is "MyPara" on double click of this paragraph it should display alert.
<p id="MyPara" style="background-color:Yellow;color:Red;font-size:2.2em;">
Double Click, Paragraph to display alert
</p>
JQuery script for showing alert on double click of paragraph
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$("#MyPara").dblclick(
function () {
ShowAlert();
}
);
});
function ShowAlert() {
alert("Alert message on double click");
}
</script>
I will be discussing more JQuery examples in JQuery example series.
No comments:
Post a Comment