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
  • Hanwen Zhang
    Hanwen Zhang
    20,084 Points

    ('li:last-child') what does the : and the name of last-child work here?

    Posted March 28, 2021 11:57pm by Hanwen Zhang
    Hanwen Zhang
    20,084 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Karl Russell Sumando Menil
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Karl Russell Sumando Menil
    Full Stack JavaScript Techdegree Student 4,004 Points

    code does not remove last item

    Posted February 11, 2021 1:37am by Karl Russell Sumando Menil
    .a{fill-rule:evenodd;}techdegree
    Karl Russell Sumando Menil
    Full Stack JavaScript Techdegree Student 4,004 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Faustin Ukundimana
    Faustin Ukundimana
    3,489 Points

    Can you guide me on how to get practice questions in one place

    Posted December 14, 2020 3:17pm by Faustin Ukundimana
    Faustin Ukundimana
    3,489 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    0 Answers

  • omar hama
    PLUS
    omar hama
    Courses Plus Student 2,773 Points

    Cannot read property 'addEventListener' of null

    Posted August 28, 2020 8:49pm by omar hama
    omar hama
    Courses Plus Student 2,773 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • MOSHE SCHWIMMER
    MOSHE SCHWIMMER
    6,301 Points

    Removing a element, through querySelector, then selecting the element, and the .length

    Posted June 16, 2020 11:05pm by MOSHE SCHWIMMER
    MOSHE SCHWIMMER
    6,301 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Jure Matković
    Jure Matković
    4,558 Points

    Removing Nodes

    Posted June 4, 2020 9:21pm by Jure Matković
    Jure Matković
    4,558 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Joel Greek
    Joel Greek
    4,421 Points

    Here is a solution for removing specific list Item.

    Posted October 4, 2019 9:41am by Joel Greek
    Joel Greek
    4,421 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Alexander D
    Alexander D
    8,685 Points

    Remove last child from another </ul> list

    Posted June 23, 2019 9:36pm by Alexander D
    Alexander D
    8,685 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Andrea Gylling
    Andrea Gylling
    2,796 Points

    Uncaught TypeError: Cannot read property 'addEventListener' of null at app.js:40

    Posted April 15, 2019 2:45pm by Andrea Gylling
    Andrea Gylling
    2,796 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Serge Zant
    Serge Zant
    10,420 Points

    Whats wrong with my code?

    Posted August 19, 2018 9:36am by Serge Zant
    Serge Zant
    10,420 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    3 Answers

  • Gremyko Coleman
    Gremyko Coleman
    9,756 Points

    remove li, code works on the treehouse workspace, but when do the same code in notepad++ it doesn't remove the li tags

    Posted August 6, 2018 6:28am by Gremyko Coleman
    Gremyko Coleman
    9,756 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Harrison Greeves
    Harrison Greeves
    2,920 Points

    My remove button won't remove the added item

    Posted July 11, 2018 12:49pm by Harrison Greeves
    Harrison Greeves
    2,920 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Jake Kobs
    Jake Kobs
    9,215 Points

    Why won't firstChild work for the code challenge?

    Posted May 30, 2018 10:04pm by Jake Kobs
    Jake Kobs
    9,215 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Jake Kobs
    Jake Kobs
    9,215 Points

    Why do we have [0] after the "document.getElementByTagName("ul")[0];"?

    Posted May 29, 2018 12:51am by Jake Kobs
    Jake Kobs
    9,215 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • S Campos
    S Campos
    413 Points

    Removing the last div within a div

    Posted March 27, 2018 1:43am by S Campos
    S Campos
    413 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    2 Answers

  • sam poplack
    sam poplack
    9,467 Points

    null is not an object

    Posted January 16, 2018 6:24am by sam poplack
    sam poplack
    9,467 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    2 Answers

  • Mariela Napoles
    Mariela Napoles
    13,434 Points

    How Do I practice all the lessons I am learning?

    Posted January 12, 2018 5:00am by Mariela Napoles
    Mariela Napoles
    13,434 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    3 Answers

  • Daniel Fitzhugh
    Daniel Fitzhugh
    9,715 Points

    How to "select all <li> elements with getElementsByTagName and use length of the collection to access the last element"?

    Posted December 13, 2017 4:18pm by Daniel Fitzhugh
    Daniel Fitzhugh
    9,715 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    2 Answers

  • ammarkhan
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points

    Remove button just removing last button

    Posted November 14, 2017 2:41pm by ammarkhan
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Henry Stiltner
    Henry Stiltner
    4,178 Points

    Check if a certain element exists

    Posted September 3, 2017 11:43pm by Henry Stiltner
    Henry Stiltner
    4,178 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    2 Answers

  • Khadar Abdulahi
    Khadar Abdulahi
    1,955 Points

    Remove item not working

    Posted June 14, 2017 1:29am by Khadar Abdulahi
    Khadar Abdulahi
    1,955 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • gennady
    gennady
    14,145 Points

    Why can't I choose last 'li' element from 'ul' using ul.lastChild?

    Posted March 13, 2017 1:17pm by gennady
    gennady
    14,145 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    1 Answer

  • Sudip Paudel
    Sudip Paudel
    2,203 Points

    The existing list items are removed when clicked on them but not the newly added items.

    Posted February 24, 2017 9:44pm by Sudip Paudel
    Sudip Paudel
    2,203 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    2 Answers

  • John Baldwin
    John Baldwin
    7,969 Points

    "Failed to execute 'removeChild' on 'Node': parameter 1 is not of type 'Node'." error message

    Posted December 13, 2016 5:24pm by John Baldwin
    John Baldwin
    7,969 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    4 Answers

  • Luca Di Pinto
    Luca Di Pinto
    8,051 Points

    Remove the list item element stored in firstListItem from the DOM.

    Posted December 3, 2016 2:41pm by Luca Di Pinto
    Luca Di Pinto
    8,051 Points
    • JavaScript
    • JavaScript and the DOM (Retiring)
    • Making Changes to the DOM
    • Removing Nodes

    2 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