HTML ondblclick 속성은 HTML 문서에서 HTML 요소를 마우스로 더블 클릭하면 발생합니다.
구문
다음은 구문입니다 -
<tagname ondblclick=”script”></tagname>
HTML ondblclick 이벤트 Attribute-
의 예를 살펴보겠습니다.예시
<!DOCTYPE html>
<html>
<head>
<style>
body {
color: #000;
height: 100vh;
background-color: #FBAB7E;
background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);
text-align: center;
}
.btn {
background: #db133a;
border: none;
height: 2rem;
border-radius: 2px;
width: 40%;
display: block;
color: #fff;
outline: none;
cursor: pointer;
margin: 1rem auto;
}
</style>
</head>
<body>
<h1>HTML ondblclick Event Attribute Demo</h1>
<button class="btn" ondblclick="display()">Double click me</button>
<div class="show"></div>
<script>
function display() {
document.querySelector('.show').innerHTML = 'Hey! you double clicked me';
}
</script>
</body>
</html> 출력

빨간색 버튼을 더블 클릭하면 마우스 더블 클릭 이벤트가 발생합니다.
