jQuery 요소 ~ 형제 선택기
예시
형제이며 <div> 요소 뒤에 나타나는 모든 <p> 요소를 선택합니다.
$("div ~ p")
정의 및 사용
("요소 ~ 형제") 선택자는 지정된 "요소" 다음에 나타나는 형제 요소를 선택합니다.
참고: 지정된 두 요소는 모두 동일한 상위 요소를 공유해야 합니다.
통사론
("element ~ siblings")
Parameter | Description |
---|---|
element | Required. Any valid jQuery selector |
siblings | Required. Specifies the siblings of the element parameter |