'Selector'에 해당되는 글 12건

  1. 2010.12.30 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값을 부여하고 있다.
Posted by IT

블로그 이미지
IT

공지사항

Yesterday
Today
Total

달력

 « |  » 2025.5
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함