Skip to content

expected value must be 3 #786

Open
@ramalingaprasad-gs

Description

@ramalingaprasad-gs

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

Activity

linked a pull request that will close this issue on Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @ramalingaprasad-gs

      Issue actions

        expected value must be 3 · Issue #786 · Asabeneh/30-Days-Of-JavaScript