jQuery dblclick() method

Configurare noua (How To)

Situatie

The dblclick() is an inbuilt method in jQuery which is used to trigger the double-click event to occur. This method occurs when the selected element will be double clicked.

Solutie

Pasi de urmat

 

<html>

<head>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script>
<script>
<!– jQuery code to show dbclick method –>
$(document).ready(function() {
$(“div”).click(function() {
$(“div”).dblclick();
});
</script>
<style>
div {
display: block;
width: 370px;
padding: 10px;
font-size: 25px;
border: 2px solid green;
}
</style>
</head>

<body>
<!– click on this div and a pop will appear –>
<div ondblclick=”alert(‘dblclick event has been triggered’)”>Click me to trigger dblclick event</div>
</body>

</html>

 

Tip solutie

Permanent

Voteaza

(4 din 10 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?