diff options
Diffstat (limited to 'files/ko/web/api/globaleventhandlers/ondblclick/index.html')
-rw-r--r-- | files/ko/web/api/globaleventhandlers/ondblclick/index.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/files/ko/web/api/globaleventhandlers/ondblclick/index.html b/files/ko/web/api/globaleventhandlers/ondblclick/index.html new file mode 100644 index 0000000000..7444c2c81b --- /dev/null +++ b/files/ko/web/api/globaleventhandlers/ondblclick/index.html @@ -0,0 +1,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"><p>Double click anywhere in this example.</p> +<p id="log"></p></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> |