aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/globaleventhandlers/ondblclick/index.html
blob: 7444c2c81bc2cba1cd04ef327321eb15153086bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: GlobalEventHandlers.ondblclick
slug: Web/API/GlobalEventHandlers/ondblclick
tags:
  - API
  - Event Handler
  - HTML DOM
  - Property
  - Reference
translation_of: Web/API/GlobalEventHandlers/ondblclick
---
<div>{{ApiRef("HTML DOM")}}</div>

<p><code><strong>ondblclick</strong></code> property는 현재 요소(element)의 onDblClick 이벤트 핸들러 코드를 돌려줍니다.</p>

<h2 id="구문">구문</h2>

<pre class="syntaxbox notranslate">element.ondblclick = function;
</pre>

<ul>
 <li><code>function</code> 은 사용자 정의 함수이며, () 나 변수를 제외하고 생성할 수 있고 또는 아래와 같이 함수명을 선언하지 않고 생성할 수 있습니다.</li>
</ul>

<pre class="brush: js notranslate">element.ondblclick = function() { console.log("ondblclick event detected!"); };
</pre>

<h2 id="예제">예제</h2>

<p>다음 예제는 더블클릭의 위치를 기록합니다.</p>

<h3 id="HTML">HTML</h3>

<pre class="brush: html notranslate">&lt;p&gt;Double click anywhere in this example.&lt;/p&gt;
&lt;p id="log"&gt;&lt;/p&gt;</pre>

<h3 id="JavaScript">JavaScript</h3>

<pre class="brush: js notranslate">let log = document.getElementById('log');

document.ondblclick = logDoubleClick;

function logDoubleClick(e) {
  log.textContent = `Position: (${e.clientX}, ${e.clientY})`;
}</pre>

<h3 id="결과">결과</h3>

<p>{{EmbedLiveSample("예제")}}</p>

<h2 id="명세">명세</h2>

<table class="spectable standard-table">
 <tbody>
  <tr>
   <th scope="col">명세</th>
   <th scope="col">상태</th>
   <th scope="col">비고</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG','webappapis.html#handler-ondblclick','ondblclick')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>

<div>{{Compat("api.GlobalEventHandlers.ondblclick")}}</div>