jquery selector example

jquery selector

jquery Element Selectors

$(this).hide()
Demonstrates the jQuery hide() method, hiding the current HTML element.
$("#test").hide()
Demonstrates the jQuery hide() method, hiding the element with id="test".
$("p").hide()
Demonstrates the jQuery hide() method, hiding all <p> elements.
$(".test").hide()
Demonstrates the jQuery hide() method, hiding all elements with class="test".

jquery Attribute Selectors

jQuery uses XPath expressions to select elements with given attributes.

$("[href]")             select all elements with an href attribute.
$("[href='#']")       select all elements with an href value equal to "#".
$("[href!='#']")     select all elements with an href attribute NOT equal to "#".
$("[href$='.jpg']") select all elements with an href attribute that ends with ".jpg".

jQuery CSS Selectors

$("p").css("background-color","yellow");    <p>Elements 의 모든 백그라운드 칼라를 Yellow 로

댓글

이 블로그의 인기 게시물

jquery css

Struts2의 작동 원리

JSP/Servlet 한글 깨짐 처리 ?