expected value must be 3
ramalingaprasad-gs opened this issue · comments
Ramalinga Prasad G S commented
const allTitles = document.getElementsByClassName('title')
console.log(allTitles) //HTMLCollections
console.log(allTitles.length) // 4 (here value must be 3, as only title is mentioned only in 3 tags)
<h1 class='title' id='first-title'>First Title</h1>
<h1 class='title' id='second-title'>Second Title</h1>
<h1 class='title' id='third-title'>Third Title</h1>
<h1></h1>
Correction in https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/21_Day_DOM/21_day_dom.md#getting-elements-by-class-name