2017년 8월 31일 목요일

JQuery start

jQuery Syntax


$(selector).action()

  • $ 표시 : jQuery의 정의, 접근 의미
  • (selector) : HTML elements
  • action() : selector가 지적한 element에 수행된다

Examples:

  • $(this).hide() - hides the current element.
  • $("p").hide() - hides all <p> elements.
  • $(".test").hide() - hides all elements with class="test".
  • $("#test").hide() - hides the element with id="test".

The Document Ready Event

모든 jQuery methods는 다음과 같이 "ready event"내부에 있다

$(document).ready(function(){

   // jQuery methods go here...

});

이것은 어느 jQuery code도 document가 loading(=ready)되기 전에는 수행되지 않는다는 것을 의미한다.

댓글 없음:

댓글 쓰기