2010. 12. 30. 12:30 jQuery
Attribute Ends With Selector [name$="value"]
속성값에 해당하는 단어를 찾을 때 사용하며 value값으로 끝나는 단어에 대해서만 찾는다.
value 의 쌍따옴표는 필수다.
사용예
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.4.4.js"></script> </head> <body> <input name="newsletter" /> <input name="milkman" /> <input name="jobletter" /> <script>$('input[name$="letter"]').val('a letter');</script> </body> </html>
위 예제는 input 태그의 name이 letter라는 단어로 끝나는 것을 전부 찾아 value값을 부여하고 있다.
'jQuery' 카테고리의 다른 글
Attribute Not Equal Selector [name!="value"] (0) | 2010.12.30 |
---|---|
Attribute Equals Selector [name="value"] (0) | 2010.12.30 |
Attribute Contains Selector [name*="value"] (0) | 2010.12.30 |
Attribute Contains Word Selector [name~="value"] (0) | 2010.12.30 |
.innerHeight() .innerWidth() (0) | 2010.12.28 |