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
  • s speir
    s speir
    3,991 Points

    Why can't we just use getElementsByClassName, instead of getElementsByTagName?

    Posted December 27, 2016 8:45pm by s speir
    s speir
    3,991 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Camila N
    Camila N
    10,677 Points

    Why can't we just use querySelector(selector)?

    Posted July 23, 2016 9:23pm by Camila N
    Camila N
    10,677 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    3 Answers

  • john larson
    john larson
    16,594 Points

    how does this: checkBox.type = "checkbox" modify this: var checkBox = document.createElement("input")

    Posted July 15, 2016 2:26pm by john larson
    john larson
    16,594 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

  • Jonas Laberg
    Jonas Laberg
    2,365 Points

    Interactive web pages with javascript: chapter 'Perform Selecting Elements': Getting error 'taskInput is not defined'

    Posted June 27, 2016 9:56am by Jonas Laberg
    Jonas Laberg
    2,365 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

  • Zach Robinson
    Zach Robinson
    8,862 Points

    Why are we using the getElementsByTagName method for the button functionality? Why not use an ID?

    Posted May 14, 2016 7:57pm by Zach Robinson
    Zach Robinson
    8,862 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Bruno Dias
    Bruno Dias
    10,554 Points

    Can I add an id for Add task button?

    Posted April 22, 2016 10:55am by Bruno Dias
    Bruno Dias
    10,554 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

  • Abirbhav Goswami
    Abirbhav Goswami
    15,450 Points

    Andrew put the wrong id in for the button.

    Posted February 23, 2016 11:15am by Abirbhav Goswami
    Abirbhav Goswami
    15,450 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

  • Yijiao Wang
    Yijiao Wang
    1,793 Points

    To what extent can we combine JQuery and Javascript in one document?

    Posted January 13, 2016 2:27pm by Yijiao Wang
    Yijiao Wang
    1,793 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

  • david marjanac
    david marjanac
    4,851 Points

    why you put in var=button array [0]

    Posted December 27, 2015 2:25pm by david marjanac
    david marjanac
    4,851 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

  • Melody Wong
    Melody Wong
    1,476 Points

    workspace is not prompting like the video

    Posted December 11, 2015 3:00pm by Melody Wong
    Melody Wong
    1,476 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    0 Answers

  • Maxwell DeMers
    Maxwell DeMers
    6,853 Points

    Uncaught Reference Error in Console

    Posted September 28, 2015 2:47pm by Maxwell DeMers
    Maxwell DeMers
    6,853 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • David Elston
    David Elston
    8,112 Points

    "function" vs. "Function"

    Posted July 28, 2015 4:34pm by David Elston
    David Elston
    8,112 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    1 Answer

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

    Selecting elements in console?

    Posted June 16, 2015 6:47pm by ammarkhan
    .a{fill-rule:evenodd;}techdegree
    ammarkhan
    Front End Web Development Techdegree Student 21,661 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Tony Brackins
    Tony Brackins
    28,766 Points

    getElementByID()...but no ID's.

    Posted June 8, 2015 3:06am by Tony Brackins
    Tony Brackins
    28,766 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • kabir k
    PLUS
    kabir k
    Courses Plus Student 18,036 Points

    pure JavaScript vs. jQuery

    Posted June 2, 2015 2:16am by kabir k
    kabir k
    Courses Plus Student 18,036 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Francesco Belvedere
    Francesco Belvedere
    15,206 Points

    Shouldnt there be semicolons at the end of each var statement when declaring a function this way?

    Posted April 14, 2015 7:53pm by Francesco Belvedere
    Francesco Belvedere
    15,206 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    8 Answers

  • Chuong Nguyen
    Chuong Nguyen
    8,256 Points

    Why use document.getElementByTagName("span")[1] instead of document.getElementsByClassName("last_name")?

    Posted March 9, 2015 5:34am by Chuong Nguyen
    Chuong Nguyen
    8,256 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Jarrett Young
    Jarrett Young
    12,635 Points

    I'm having trouble completing the code challenge in the section following this video. Can't pass the second step.

    Posted February 14, 2015 1:17am by Jarrett Young
    Jarrett Young
    12,635 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    3 Answers

  • Reid Larson
    Reid Larson
    12,711 Points

    why is everything coming up as undefined?

    Posted February 4, 2015 6:42pm by Reid Larson
    Reid Larson
    12,711 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Joe Williams
    Joe Williams
    4,014 Points

    Unsure of what the HTML label is doing if I'm already using an Input ID

    Posted January 22, 2015 10:20pm by Joe Williams
    Joe Williams
    4,014 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Muhammad Rizwan
    Muhammad Rizwan
    8,595 Points

    We did not create any array how can we use following code? var addButton= getElementsByTagName('button')[0];

    Posted November 30, 2014 10:42pm by Muhammad Rizwan
    Muhammad Rizwan
    8,595 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    4 Answers

  • Radha Bhambwani
    Radha Bhambwani
    10,182 Points

    Using firefox console instead of chrome's

    Posted November 27, 2014 5:41pm by Radha Bhambwani
    Radha Bhambwani
    10,182 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • jadaml
    jadaml
    11,593 Points

    Calls to variable in console coming up as not defined

    Posted November 22, 2014 10:17pm by jadaml
    jadaml
    11,593 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    4 Answers

  • Anna Steirer
    Anna Steirer
    6,734 Points

    Having same problem as below where the workspace is returning undefined variables. I have not tried other workspaces.

    Posted November 11, 2014 2:22am by Anna Steirer
    Anna Steirer
    6,734 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    3 Answers

  • Ron L
    Ron L
    6,463 Points

    Code doesn't work in Workspace, but does in Sublime

    Posted October 29, 2014 8:05pm by Ron L
    Ron L
    6,463 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    3 Answers

  • Leah Thompson
    Leah Thompson
    14,997 Points

    variables not defined

    Posted October 9, 2014 2:22pm by Leah Thompson
    Leah Thompson
    14,997 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    2 Answers

  • Eric Vandenberg
    Eric Vandenberg
    9,095 Points

    Can't define a variable in Sublime

    Posted September 3, 2014 1:40am by Eric Vandenberg
    Eric Vandenberg
    9,095 Points
    • JavaScript
    • Interactive Web Pages with JavaScript
    • Selecting Elements and Adding Events with JavaScript
    • Perform: Selecting Elements

    8 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