Last Updated : 11 Jul, 2025
The ondblclick Attribute Event occurs when a user fires the mouse Double click on Element. It is triggered when a user double-clicks on an HTML element and is used to initiate actions or functions in response to a double-click event.
It also enables interactive features like opening pop-ups, displaying details, or toggling elements.
Syntax:<element ondblclick="script">Supported Tags:
It supports All HTML elements, EXCEPT below listed elements:
Attribute Values :This method have attributes with value <script> and this has to be run on ondblclick.
Example 1:In this example, we will see the the implementation of ondblclick tag.
HTML
<!DOCTYPE html>
<html>
<body>
<center>
<h1 style="color:green;font-style:italic;">
GeeksForGeeks
</h1>
<h2 style="color:green;font-style:italic;">
odblclick Event Attribute
</h2>
<button ondblclick="Geeks()">
Double-click me
</button>
<p id="sudo"></p>
<script>
function Geeks() {
document.getElementById("sudo")
.innerHTML = "Geeks For Geeks";
}
</script>
</center>
</body>
</html>
Output:
Output Example2:In this example, we will see the the implementation of ondblclick tag with another example.
HTML
<!DOCTYPE html>
<html>
<body>
<center>
<h1 style="color:green;font-weight:bold;">
GeeksforGeeks
</h1>
<h2 style="color:blue;">
ondblclick Event Attribute
</h2>
<div ondblclick="ChangeTitle()">
<p>Double-click here</p>
</div>
<p id="title"></p>
<script>
function ChangeTitle() {
document.getElementById("title")
.innerHTML = "Title Changed!";
}
</script>
</center>
</body>
</html>
Output:
Supported Browsers:RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4