티스토리 뷰

Events

Events란 웹사이트에서 발생하는 모든것들을 일컫는말 이다. 예를 들어 click,resize,submit,inputchange등등을 말할수있다.그리고 JavaScript는 이 이벤트를 중간에 가로챌 수 있다.

 

예시 1. 윈도우 창의 Resize 이벤트

 

function handleResize(){
    console.log("I have been resized");
}
window.addEventListener("resize", handleResize()); // handleResize 함수 자동 호출
window.addEventListener("resize", handleResize); // 원할 때 handleResize 호출 (resize event가 발생할 때)

 

'노마드코더 > Vanilla JS' 카테고리의 다른 글

#0-1 Requirements  (0) 2021.08.28
#2-5 첫번째 조건문!! If, else, and, or  (0) 2021.08.28
#2-3 Modifying the DOM with JS  (0) 2021.08.28
#2-2 JS DOM Functions  (0) 2021.08.28
#2-1 너의 첫번째 함수! (Your first JS Function)  (0) 2021.08.28
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/09   »
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
글 보관함