/

HTML / CSS / JavaScript Tutorial

HTML Event attribute: ondblclick

[this page | pdf | back links]

The HTML ondblclick attribute specifies the event that is triggered when an element is double-clicked (mouse double-clicked). It applies to all visible elements.

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head></head>
<body>
ondblclick: try double-clicking this
<span style="background-color: yellow;" ondblclick="myOndblclick()">element</span><br>

<script>
function myOndblclick() {alert("Double-clicking element");}
</script>

</body>
</html>


NAVIGATION LINKS
Contents | Prev | Next | HTML Attributes


Desktop view | Switch to Mobile