<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<ul class="ulooo">
		<li>11</li>
		<li>22</li>
		<li>33</li>
		<li>44</li>
		<li>55</li>
		<li>66</li>
	</ul>
	<script type="text/javascript">
		document.write('第一個被選到的是:'+document.querySelector('.ulooo li').textContent+'<br>');
		document.write('總共被選到的數量:'+document.querySelectorAll('.ulooo li').length);
	</script>
</body>
</html>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Jerry 的頭像
    Jerry

    Bug倉庫 // 程式日記

    Jerry 發表在 痞客邦 留言(0) 人氣()