EX)
document.getElementById("아이디명").onclick = function(){
...
}
// 이벤트 핸들러에는 세미콜론을 찍어도 되고 안찍어도 된다.
// === 첫번째 표현방법 === //
이벤트소스.이벤트 = function(){
// = function(){} 은 이벤트 핸들러
...
// 이 안에서 this 를 사용할 시
// "이벤트소스" 인 자기자신의 객체를 뜻한다.
}
// === 두번째 표현방법 === //
이벤트소스.addEventListener("keyup", function(e){
// e 는 이벤트의 약자
// 이벤트 : keyup
// function(){} 은 이벤트 핸들러
...
함수명(e.target); // input 태그를 가리킨다.
alert(e.target.value); // 입력된 값
})
04_typeof
-> typeof.html, typeof.css, typeof.js
08_getElement_querySelectorAll
-> getElement_querySelectorAll.html, getElement_querySelectorAll.css, getElement_querySelectorAll.js
09javascriptStandardObject-> 01_Array_class
-> 04금액계산하기.html, 04.css, 04.js