• 회원가입
  • 로그인
  • 구글아이디로 로그인

[DOM_Event] JS - touchend 이벤트 (= ontouchend 속성) - 손가락 뗄 때 이벤트 발생 (= 터치이벤트 = 온터치속성)

목차

  1. touchend 예제 - 손가락 뗄 때 이벤트 발생
  2. touchend 정의
  3. touchend 구문

 

touchend 예제 - 손가락 뗄 때 이벤트 발생

 

<p ontouchend="homzzang()">여기터치</p>


<p id="demo"></p>


<script>

function homzzang() {

  document.getElementById("demo").innerHTML = "홈짱닷컴 Homzzang.com";

}

</script>

 

결과보기

 

touchend 정의

 

터치 스크린 장치에서 사용자가 요소에서 손가락 떼면 이벤트 발생.

 



1. 

터치 스크린 없는 장치에선 작동 X


2. cf. 관련 이벤트

  • touchstart - 손가락으로 요소 터치할 때 발생
  • touchend - 요소에서 손가락 떼면 발생 
  • touchmove - 화면에서 손가락 움직일 때 발생
  • touchcancel - 터치 중단될 때 발생

 

3.

  • 이벤트확산: O
  • 취소가능성: O
  • 이벤트타입: TouchEvent
  • 지원태그: 모든 HTML 요소

 

4.

Safari, Opera 제외한 주요 최신 브라우저 모두 지원.

 

5. MDN touchend 이벤트 예제 보기

https://developer.mozilla.org/en-US/docs/Web/API/Document/touchend_event

 

 

touchend 구문

 

HTML 속성 방식

<element ontouchend="myScript">


JS 속성 방식

object.ontouchend = myScript;


JS 메서드 방식

object.addEventListener("touchend", myScript);

 

PS1. JS메서드 방식 경우, 이벤트명에 on 안 붙임.

PS2. JS메서드 방식 경우, 실행함수명 뒤에 () 안 붙임.


분류 제목
DOM_Style JS - fontSize 속성 - 글자크기 (= 폰트크기 = fontSize속성 = 폰트사이즈 속성)
DOM_Style JS - fontStyle 속성 - 글자모양 (= font-style속성 = 글씨체모양 = 글씨모양 = 글자…
DOM_Style JS - fontVariant 속성 - (소문자/보통) 크기의 대문자로 설정/반환.
DOM_Style JS - fontWeight 속성 - 글자굵기 (= font-weight속성 = 폰트굵기 = 글씨체굵기 =글…
DOM_Style JS - fontSizeAdjust -
DOM_Style JS - fontStretch -
DOM_Style JS - hangingPunctuation -
DOM_Style JS - height 속성 - 요소 높이 설정/반환 (= height속성 = 하이트속성) ※ 요소 세로길이 …
DOM_Style JS - hyphens -
DOM_Style JS - icon -
DOM_Style JS - imageOrientation -
DOM_Style JS - isolation -
DOM_Style JS - justifyContent 속성 - flex 항목 세로 정렬 설정/반환 (= justifyConte…
DOM_Style JS - left 속성 - 왼쪽기준 (= left속성 = 좌측기준 = 레프트속성, 상속 X)
DOM_Style JS - letterSpacing 속성 ★ - 글자 간격 반환/설정 ( 텍스트사이띄우기 = 문자 간격 = 글…
DOM_Style JS - lineHeight 속성 ★ - 텍스트라인높이 (= line-height속성 = 텍스트줄높이 = 글…
DOM_Style JS - listStyle -
DOM_Style JS - listStyleImage -
DOM_Style JS - listStylePosition -
DOM_Style JS - listStyleType 속성 - 리스트 마커 모양 (= listStyleType속성 / 리스트스타…
47/67
목록
찾아주셔서 감사합니다. Since 2012