1
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<ul>
<li>HTML</li>
<li>CSS</li>
<li id="active">JavaScript</li>
</ul>
<script src="../dil/jQuery_3.5.js"></script>
<script>
console.group('before');
var lis = document.getElementsByTagName('li');
for(var i = 0; i < lis.length; i++){
console.log(lis[i]);
}
console.groupEnd();
console.group('after');
lis[1].parentNode.removeChild(lis[1]);
for (var i = 0; i < lis.length; i++){
console.log(lis[i]);
}
console.groupEnd();
</script>
</body>
</html>
'HTML 참고서 > HTML 생활코딩 Youtube' 카테고리의 다른 글
13.JavaScript jQuery 조회범위 (0) | 2020.04.16 |
---|---|
12.JavaScript API (0) | 2020.04.16 |
10. JavaScript Element (0) | 2020.04.14 |
9. JavaScript jQuery (0) | 2020.04.12 |
8. JavaScript 제어대상 찾기 (0) | 2020.04.12 |