DOM

제어대상 찾기

getelements by tagname, classname, query selector All

getelement by id, query selector

query selector는 첫번째 값만 회신하다.

jQuery

아래와 같이 jQuery( document ).ready(function( $ ) {})로 감싸는 것이 이상적이다.

jQuery( document ).ready(function( $ ) {
  $('body').prepend('<h1>Hello world</h1>');
});

HTMLELement

HTMLELement은 getElement*의 실행 값이 하나 일 경우 리턴되는 값이이다. 그리고 엘리먼트 종류에 따라서 리턴되는 객체가 조금씩 다르다 왜냐하면 각각의 엘리먼트들의 기능이 다르기에 프로퍼티 또한 다르기 때문에

HTMLCollection

HTMLCollection은 리턴 결과가 복수인 경우에 사용하게 되는 객체다.