✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

AI can only take you so far. 🌟 Start with core skills in JavaScript, HTML, CSS, or Python. 🚀

Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

AI can only take you so far. 🌟 Start with core skills in JavaScript, HTML, CSS, or Python. 🚀

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
    • Showing results for:
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name
    • Close
  • emmanuel egunjobi
    emmanuel egunjobi
    4,475 Points

    Color not changing getting error Uncaught TypeError: Cannot read property 'style' of undefined at app.js:5

    Posted on Mar 28, 2021 by emmanuel egunjobi
    emmanuel egunjobi
    4,475 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Jeremiah Marcos
    Jeremiah Marcos
    4,091 Points

    when do i use class or id?

    Posted on Jan 15, 2021 by Jeremiah Marcos
    Jeremiah Marcos
    4,091 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Kirt Perez
    Kirt Perez
    7,374 Points

    Typo in teachers notes, the getElementsByClass method is written as getElementByClass, missing the plural in "Elements"

    Posted on Nov 16, 2020 by Kirt Perez
    Kirt Perez
    7,374 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Matt Roberts
    Matt Roberts
    5,173 Points

    The elements are not changing purple or red respectively and I don't know why

    Posted on Apr 14, 2020 by Matt Roberts
    Matt Roberts
    5,173 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    4 Answers

  • Grant Evans
    Grant Evans
    3,259 Points

    Identifier already declared issue when running the 'for' loop with GetElementsbyTagName/ID

    Posted on Dec 3, 2019 by Grant Evans
    Grant Evans
    3,259 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    2 Answers

  • Vijayalaxmi vastrad
    Vijayalaxmi vastrad
    2,789 Points

    getElementsByCLassName() not effecting

    Posted on Sep 22, 2019 by Vijayalaxmi vastrad
    Vijayalaxmi vastrad
    2,789 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    2 Answers

  • Marc Sanchez
    Marc Sanchez
    20,039 Points

    Why would I use JS to change text color instead of CSS? It's more code with JS and takes my space.

    Posted on Jun 20, 2019 by Marc Sanchez
    Marc Sanchez
    20,039 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Jason Massey
    Jason Massey
    16,635 Points

    Refactoring this code using if-loop within the for-loop

    Posted on Apr 10, 2019 by Jason Massey
    Jason Massey
    16,635 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Luke Markham
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Luke Markham
    Front End Web Development Techdegree Graduate 17,289 Points

    Specificity in JS

    Posted on Mar 19, 2019 by Luke Markham
    .a{fill-rule:evenodd;}techdegree seal-36
    Luke Markham
    Front End Web Development Techdegree Graduate 17,289 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    4 Answers

  • mk37
    mk37
    10,271 Points

    honesty, i dont know why this for loop not working

    Posted on Nov 24, 2018 by mk37
    mk37
    10,271 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Monroe Gollaher
    Monroe Gollaher
    7,301 Points

    Color not changing and "app.js:4 Uncaught TypeError: Cannot read property 'style' of undefined at app.js:4"

    Posted on Jun 20, 2018 by Monroe Gollaher
    Monroe Gollaher
    7,301 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Jake Kobs
    Jake Kobs
    9,215 Points

    Would this be a simpler way of going at the non-purple items on the list?

    Posted on May 30, 2018 by Jake Kobs
    Jake Kobs
    9,215 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Stephen Gough Jr
    Stephen Gough Jr
    4,187 Points

    Adding EventListener to this video's code

    Posted on Mar 8, 2018 by Stephen Gough Jr
    Stephen Gough Jr
    4,187 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • tal Shnitzer
    PLUS
    tal Shnitzer
    Courses Plus Student 5,242 Points

    is there an option to listen to this course slow speed?

    Posted on Mar 3, 2018 by tal Shnitzer
    tal Shnitzer
    Courses Plus Student 5,242 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Caitlin S
    Caitlin S
    2,882 Points

    Items not changing to red.

    Posted on Jan 9, 2018 by Caitlin S
    Caitlin S
    2,882 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    2 Answers

  • Umair Abid
    PLUS
    Umair Abid
    Courses Plus Student 4,463 Points

    Color not changing

    Posted on Nov 29, 2017 by Umair Abid
    Umair Abid
    Courses Plus Student 4,463 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • Vic Mercier
    Vic Mercier
    3,276 Points

    Dom and class

    Posted on Jun 8, 2017 by Vic Mercier
    Vic Mercier
    3,276 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    2 Answers

  • Greg Schudel
    Greg Schudel
    4,090 Points

    what is let in javascript?

    Posted on Apr 21, 2017 by Greg Schudel
    Greg Schudel
    4,090 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    2 Answers

  • MIAN OSAMA ARSHAD
    PLUS
    MIAN OSAMA ARSHAD
    Courses Plus Student 1,569 Points

    Uncaught TypeError: Cannot set property 'color' of undefined at script.js:22

    Posted on Mar 20, 2017 by MIAN OSAMA ARSHAD
    MIAN OSAMA ARSHAD
    Courses Plus Student 1,569 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

  • nathanielcusano
    nathanielcusano
    9,808 Points

    Don't get the difference between setting a variable = document.getElementsByTagName("BODY")[0]; and ...

    Posted on Feb 18, 2017 by nathanielcusano
    nathanielcusano
    9,808 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Getting a Handle on the DOM
    • Selecting Elements with the Same Class Name

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.