반응형
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
$(document).ready(function() {
$("li:eq(0)")
.next()
.text("next 활용")
.css("background", "red");
$("li:eq(2)")
.nextAll()
.text("nextAll활용")
.css("background", "blue");
});
</script>
<title>Document</title>
</head>
<body>
<ul>
<li>원숭이</li>
<li>호랑이</li>
<li>낙타</li>
<li>박쥐</li>
<li>쥐며느리</li>
<li>리어카</li>
</ul>
</body>
</html>
반응형
'2020 > JQuery' 카테고리의 다른 글
JQuery children, parent, parents, siblings (0) | 2020.03.06 |
---|---|
JQuery not() (0) | 2020.03.06 |
jquery animation stop (0) | 2020.03.06 |
JQuery 엘리먼트 순서 알아내기 (0) | 2020.03.05 |
JQuery height, width (0) | 2020.03.05 |