티스토리 뷰

카테고리 없음

jQuery Syntax(문법)

James Wetzel 2011. 8. 6. 15:00
$(this).hide()
Demonstrates the jQuery hide() method, hiding the current HTML element.
현재의 html 요소를 숨긴다. 

$("#test").hide()
Demonstrates the jQuery hide() method, hiding the element with id="test".
아이디가 "test"인 요소를 숨긴다.

$("p").hide()
Demonstrates the jQuery hide() method, hiding all <p> elements.
p인 요소를 숨긴다.

$(".test").hide()
Demonstrates the jQuery hide() method, hiding all elements with class="test".
클래스가(스타일 클래스를 의미) "test"인 요소를 숨긴다.

 *모든 jQuery는 $(document).ready(funtion() {  해당 위치에 작성되어야 합니다.!  })
 이렇게 하지 않을 경우 문서가 로딩되기 전에 jQuery가 실행되어 예상하지 못했던 에러가 발생할 수 있습니다.
728x90
반응형