touchstart
이벤트를 위한 global event handler
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Note: 이 요소는 아직 표준화 되지 않은 기술입니다. It is specified in the Touch Events – Level 2 Draft 명세에서 작성된 기술이며 Touch Events Recommendation에는 포함되어 있지 않습니다. 따라서 아직 대부분의 브라우저에서는 사용되지 않는 요소입니다.
문법
var startHandler = someElement.ontouchstart;
반환 값
startHandler
someElement
를 위한 touchstart 이벤트 핸들러
예제
이 예제는 HTML 요소에 touchstart e이벤트 핸들러를 등록하기 위한 두 방법을 보여주고 있습니다.
<html>
<script>
function startTouch(ev) {
// 이벤트 내부
}
function init() {
var el=document.getElementById("target1");
el.ontouchstart = startTouch;
}
</script>
<body onload="init();">
<div id="target1"> 터치해주세요... </div>
<div id="target2" ontouchstart="startTouch(event)"> 터치해주세요... </div>
</body>
</html>
명세
명세 | 현황 | 비고 |
---|---|---|
Touch Events – Level 2 | Draft | Non-stable version. |
브라우저 호환성
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support |
Feature | Android | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|
Basic support |