<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<ul>
<li></li>
<li id="green"></li>
<li></li>
<li></li>
<li></li>
</ul>
<script>
//获取单个li标签
var green = document.querySelector(".green");
//获取全部li标签
var lis = document.querySelectorAll("li");
</script>
</body>
</html>
网友评论