Skip to main content

Notice: Workspaces are undergoing maintenance and are temporarily unavailable.

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

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

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

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • 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
  • 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 March 28, 2021 10:10am 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 January 15, 2021 4:49pm 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 November 16, 2020 4:44am 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 April 14, 2020 1:31pm 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 December 3, 2019 12:10am 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 September 22, 2019 7:15am 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 June 20, 2019 2:57am 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 April 10, 2019 7:07pm 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 March 19, 2019 9:49am 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 November 24, 2018 4:18pm 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 June 20, 2018 6:41pm 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 May 30, 2018 6:27pm 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 March 8, 2018 1:50am 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 March 3, 2018 3:42pm 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 January 9, 2018 8:38pm 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 November 29, 2017 7:28pm 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 June 8, 2017 11:32pm 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 April 21, 2017 6:18pm 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 March 20, 2017 11:08am 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 February 18, 2017 12:44am 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.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

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

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord