COMING SOON 🚀

제이쿼리 Attribute Contains Selector [name*=”value”]

· 8년 전 · 1515

제이쿼리 Attribute Contains Selector [name*=”value”]


설명 : 지정된 하위 문자열이 포함 된 값으로 지정된 속성이있는 요소를 선택합니다.


이것은 값과 일치하는 jQuery 애트리뷰트 선택자 중 가장 관대하다. 


선택기의 문자열이 요소의 속성 값 내의 아무 곳에 나 나타나는 경우 요소를 선택합니다. 


이 선택기를 속성 포함 단어 선택기 (예 : [attr ~ = "word"])와 비교하면 많은 경우에 더 적합합니다.


예:

'man'을 포함하는 이름 속성을 가진 모든 입력을 찾아 그 값을 텍스트로 설정합니다.


<!doctype html>

<html lang="en">

<head>

  <meta charset="utf-8">

  <title>attributeContains demo</title>

  <script src="https://code.jquery.com/jquery-1.10.2.js"></script>

</head>

<body>

 

<input name="man-news">

<input name="milkman">

<input name="letterman2">

<input name="newmilk">

 

<script>

$( "input[name*='man']" ).val( "has man in it!" );

</script>

 

</body>

</html>



|
댓글을 작성하시려면 로그인이 필요합니다.

개발자팁

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
jQuery 8년 전 조회 2,412
jQuery 8년 전 조회 1,904
PHP 8년 전 조회 3,947
jQuery 8년 전 조회 1,800
jQuery 8년 전 조회 2,089
jQuery 8년 전 조회 1,936
jQuery 8년 전 조회 1,698
jQuery 8년 전 조회 2,367
jQuery 8년 전 조회 1,900
jQuery 8년 전 조회 2,215
jQuery 8년 전 조회 1,995
jQuery 8년 전 조회 2,233
jQuery 8년 전 조회 1,920
jQuery 8년 전 조회 1,703
jQuery 8년 전 조회 1,516
jQuery 8년 전 조회 1,949
jQuery 8년 전 조회 2,574
jQuery 8년 전 조회 1,579
jQuery 8년 전 조회 1,987
jQuery 8년 전 조회 1,963
jQuery 8년 전 조회 2,765
jQuery 8년 전 조회 2,247
jQuery 8년 전 조회 2,145
jQuery 8년 전 조회 2,123
jQuery 8년 전 조회 1,880
jQuery 8년 전 조회 1,268
jQuery 8년 전 조회 1,943
jQuery 8년 전 조회 2,687
jQuery 8년 전 조회 2,575
jQuery 8년 전 조회 1,949