티스토리 뷰
728x90
반응형
-even
짝수
ex)
$('p:even').css('backgroundColor', 'black');
-odd
홀수
$('p:odd').css('backgroundColor','skyblue');
-eq
해당 인덱스 선택
$('p:eq(2)').css('backgroundColor','lime');
-gt
해당 인덱스 보다 큰 인덱스들 선택
$('p:gt(1)').css('backgroundColor','pink');
-lt
해당 인덱스 보다 작은 인덱스들 선택
$('p:lt(1)').css('backgrounColor','beige');
728x90
'jQuery' 카테고리의 다른 글
| jQuery sideways(옆) 메소드 (0) | 2020.03.07 |
|---|---|
| jQuery 이벤트에서 this의 차이점 (0) | 2020.03.07 |
| jQuery Descendants(자손) 메소드 (0) | 2020.03.07 |
| jQuery Ancestors(조상) 메소드 (0) | 2020.03.07 |
| jQuery filter(필터링 함수) (0) | 2020.03.07 |
댓글