<html>
<body>
<h1>Finding HTML Elements by Query Selector</h1>
<p class="intro">Hello World!</p>
<p class="intro">Hello China!</p>
<p class="intro">Hello Shanghai!</p>
<p id="demo"></p>
<script>
var myElements = document.querySelectorAll("p.intro");
document.getElementById("demo").innerHTML = "类名为 intro 的第三段文本是:" + myElements[0].innerHTML;
</script>
</body>
</html>