Skip to main content

🛍️ BLACK FRIDAY get-one-give-one sale is underway. Don't miss $50 off PLUS a free subscription to gift a friend. 🤩

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

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
  • Anna Fiialka
    Anna Fiialka
    2,855 Points

    Please help I can`t understand my task clearly. I need on the anchor to add new classList "selected". How I can do it?

    Posted September 19, 2016 12:17am by Anna Fiialka
    Anna Fiialka
    2,855 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    2 Answers

  • Anusha Singh
    PLUS
    Anusha Singh
    Courses Plus Student 22,106 Points

    Can you help??

    Posted May 2, 2016 4:46pm by Anusha Singh
    Anusha Singh
    Courses Plus Student 22,106 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    2 Answers

  • Anusha Singh
    PLUS
    Anusha Singh
    Courses Plus Student 22,106 Points

    Can you help??

    Posted May 2, 2016 4:40pm by Anusha Singh
    Anusha Singh
    Courses Plus Student 22,106 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    1 Answer

  • John Harles
    John Harles
    20,614 Points

    perform: changing classes challenge task 1

    Posted August 28, 2015 12:11am by John Harles
    John Harles
    20,614 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    0 Answers

  • Donald Richmond
    Donald Richmond
    13,807 Points

    How do you use the classList property to add a new class of "selected" to the anchor element???

    Posted July 6, 2015 1:45am by Donald Richmond
    Donald Richmond
    13,807 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    2 Answers

  • Bappy Golder
    Bappy Golder
    13,449 Points

    Not sure why this code is not passing and/or what I am getting wrong.

    Posted June 12, 2015 3:17am by Bappy Golder
    Bappy Golder
    13,449 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    1 Answer

  • Brian Bartlett
    Brian Bartlett
    20,278 Points

    Why doesn't this work for task2? anchor.classList.toggle("live");

    Posted March 26, 2015 10:41pm by Brian Bartlett
    Brian Bartlett
    20,278 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    2 Answers

  • San Francisco
    San Francisco
    28,373 Points

    Challenge Task 1 of 2 On line 5 of app.js, use the classList property on the anchor to add a new class of "selected"

    Posted March 26, 2015 8:20pm by San Francisco
    San Francisco
    28,373 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    1 Answer

  • Sally Gradle
    Sally Gradle
    24,694 Points

    Task 1 is to add class "selected" to anchor, but error references function "live"??

    Posted January 29, 2015 3:19am by Sally Gradle
    Sally Gradle
    24,694 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    1 Answer

  • Alexander Stanuga
    Alexander Stanuga
    11,999 Points

    keeps telling me "You didn't pass the toggle() method"

    Posted December 1, 2014 10:58am by Alexander Stanuga
    Alexander Stanuga
    11,999 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    2 Answers

  • shah den
    shah den
    1,508 Points

    interactive pages with javascript

    Posted November 9, 2014 10:20am by shah den
    shah den
    1,508 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    2 Answers

  • Sura Salman
    Sura Salman
    7,204 Points

    On line 5 of app.js, use the classList property on the anchor to add a new class of "selected" to it.

    Posted September 17, 2014 2:13am by Sura Salman
    Sura Salman
    7,204 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    10 Answers

  • Keith Doyle
    Keith Doyle
    25,973 Points

    Interactive Web Pages - classList.toggle isn't working

    Posted September 3, 2014 7:12pm by Keith Doyle
    Keith Doyle
    25,973 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Traversing and Manipulating the DOM with JavaScript
    • Changing Classes

    7 Answers

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