按標籤名稱

document.getElementsByTagName('b')

將檢索

<b>All</b>
<b>of</b>
<b>the b elements.</b>

如果不存在具有給定標記名稱的元素,則將返回空集合。