(jQuery)제이쿼리 셀렉터 총정리 02편! jQuery Selector

jQuery에서 필수적으로 사용하게 되는 셀렉터! 에 대해 알아보겠습니다.


버튼 셀렉터 :button Selector

jQuery( “:button” )
Selects all button elements and elements of type button.
타입이 button인 모든 요소를 선택합니다.


체크박스 셀렉터 :checkbox Selector

jQuery( “:checkbox” )
Selects all elements of type checkbox.
타입이 checkbox인 모든 요소를 선택합니다.


체크드 셀렉터 :checked Selector

jQuery( “:checked” )
Matches all elements that are checked or selected.
checkbox에서 선택된 요소들만 선택합니다.


속성 컨테인 워드 셀렉터 Attribute Contains Word Selector [name~=”value”]

jQuery( “[attribute~=’value’]” )
Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.
속성에 원하는 문자를 선택하는데 공백으로 구분합니다. 문자가 앞에서 시작하든 중간에서 시작하든 상관없지만, 공백으로 나누어 있어야 합니다.


속성 엔드 셀렉터 Attribute Ends With Selector [name$=”value”]

jQuery( “[attribute$=’value’]” )
Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.
속성에 원하는 문자열로 정확하게 끝나야 선택됩니다. 대소문자를 구별하여 선택됩니다.


속성 이퀄 셀렉터 Attribute Equals Selector [name=”value”]

jQuery( “[attribute=’value’]” )
Selects elements that have the specified attribute with a value exactly equal to a certain value.
속성에 원하는 문자열로 정확 일치하는 요소를 선택합니다. 대소문자를 구별하여 선택됩니다.


속성 스타트 셀렉터 Attribute Starts With Selector [name^=”value”]

jQuery( “[attribute^=’value’]” )
Selects elements that have the specified attribute with a value beginning exactly with a given string.
속성에 원하는 문자열로 정확하게 시작해야 선택됩니다. 대소문자를 구별하여 선택됩니다.


더 많은 셀렉터는 다음 기회에 만나보겠습니다.

Reference

Share