"JQuery .nextAll()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 6개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;jQuery .nextAll()
;jQuery .nextAll()
* 이후의 모든 요소를 선택하는 jQuery 메소드
:단 셀렉터 있을 경우, 그에 따라 대상이 한정됨
<syntaxhighlight lang='html5'>
<script src='//code.jquery.com/jquery.min.js'></script>
<script>
$(function(){
    $('#mybox').nextAll().css('background', 'yellow');
    $('#mybox').nextAll('.red-text').css('color', 'red');
});
</script>
<div>
    <div>박스1</div>
    <div id='mybox'>박스2</div>
    <div>박스3</div>
    <div class='red-text'>박스4</div>
    <div class='red-text'>박스5</div>
    <div>박스6</div>
</div>
</syntaxhighlight>
<jsfiddle height='200'>jfja5wpo</jsfiddle>


==같이 보기==
==같이 보기==
*[[jQuery .next()]]
*[[jQuery .next()]]
*[[jQuery .nextUntil()]]
*[[jQuery .nextUntil()]]
*[[jQuery .parentsUntil()]]
*[[jQuery .prevAll()]]


==참고 자료==
==참고==
*https://api.jquery.com/nextAll/
*https://api.jquery.com/nextAll/
*http://www.w3schools.com/jquery/traversing_nextall.asp
*http://www.w3schools.com/jquery/traversing_nextall.asp


[[분류: jQuery]]
[[분류: jQuery]]

2020년 11월 2일 (월) 02:53 기준 최신판

1 개요[ | ]

jQuery .nextAll()
  • 이후의 모든 요소를 선택하는 jQuery 메소드
단 셀렉터 있을 경우, 그에 따라 대상이 한정됨
<script src='//code.jquery.com/jquery.min.js'></script>
<script>
$(function(){
    $('#mybox').nextAll().css('background', 'yellow');
    $('#mybox').nextAll('.red-text').css('color', 'red');
});
</script>
<div>
    <div>박스1</div>
    <div id='mybox'>박스2</div>
    <div>박스3</div>
    <div class='red-text'>박스4</div>
    <div class='red-text'>박스5</div>
    <div>박스6</div>
</div>

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}