Wednesday, September 17, 2025
HomeLanguagesJavascriptHTML | ondblclick Event Attribute

HTML | ondblclick Event Attribute

This Attribute Event occurs when a user fires mouse Double click on the Element. It is a part of Event Attribute.
Supported Tags: It supports All HTML elements, EXCEPT:

  •  <base>
  • <bdo>
  • <br>
  • <head>
  • <html>
  • <iframe>
  • <meta>
  • <param>
  • <script>
  • <style>
  •  <title>

Syntax: 

<element ondblclick="script"> 

Elements: This method can have following attributes: 

  • <script>

Attribute: The script to be run on ondblclick event Attribute.
Example: 

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: 

Supported Browsers: The browser supported by ondblclick Event Attribute are listed below: 

  • Apple Safari 3
  • Google Chrome 1
  • Edge 12
  • Firefox 6
  • Opera 11.6
  • Internet Explorer 8
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32299 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6660 POSTS0 COMMENTS
Nicole Veronica
11833 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11895 POSTS0 COMMENTS
Shaida Kate Naidoo
6779 POSTS0 COMMENTS
Ted Musemwa
7050 POSTS0 COMMENTS
Thapelo Manthata
6735 POSTS0 COMMENTS
Umr Jansen
6741 POSTS0 COMMENTS