<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<ul>
<li class="marked">html</li>
<li>css</li>
<li id="active">JavaScript
<ul>
<li>JavaScript Core</li>
<li class="marked">DOM</li>
<li class="marked">BOM</li>
</ul>
</li>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
//$( ".marked", "#active").css( "background-color", "red" );
//$('#active').find('.marked').css("background-color","red");
$('#active').css('color', 'blue').find('.marked').css("background-color", "red")
</script>
</body>
</html>
어디에 무엇을 변경할지
#은 아이디 $는 jquery이 . 은 class
'HTML 참고서 > HTML 생활코딩 Youtube' 카테고리의 다른 글
15.JavaScript Node API (0) | 2020.04.16 |
---|---|
14. JavaScript Node (0) | 2020.04.16 |
12.JavaScript API (0) | 2020.04.16 |
11.JavaScript Collection (0) | 2020.04.14 |
10. JavaScript Element (0) | 2020.04.14 |