Skip to main content

🚀 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
  • Sunyul Kim
    Sunyul Kim
    2,646 Points

    how to complete the first task of selecting by ID from JavaScript and the DOM

    Posted October 22, 2026 9:04pm by Sunyul Kim
    Sunyul Kim
    2,646 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Sunyul Kim
    Sunyul Kim
    2,646 Points

    how to complete the first task of select by ID in JavaScript and the DOM

    Posted October 21, 2026 9:26pm by Sunyul Kim
    Sunyul Kim
    2,646 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Roy Cma
    Roy Cma
    3,147 Points

    getting an element by its ID

    Posted August 26, 2024 5:17am by Roy Cma
    Roy Cma
    3,147 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    3 Answers

  • Vasil Ginin
    Vasil Ginin
    9,919 Points

    Can you guys please help me with this one I tried everything.

    Posted May 19, 2024 10:20pm by Vasil Ginin
    Vasil Ginin
    9,919 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Nicholas Mason
    Nicholas Mason
    2,313 Points

    I'm super confused

    Posted November 9, 2023 12:40am by Nicholas Mason
    Nicholas Mason
    2,313 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    2 Answers

  • Ericka Erickson
    Ericka Erickson
    9,982 Points

    const button = document.getElementById("btn-pharse"); is this not right?

    Posted October 17, 2023 5:38pm by Ericka Erickson
    Ericka Erickson
    9,982 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Michael Lugo
    Michael Lugo
    4,921 Points

    Javascript and the DOM getElementById method challenge question...

    Posted January 16, 2023 9:11pm by Michael Lugo
    Michael Lugo
    4,921 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Chiaki Yamada
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Chiaki Yamada
    Front End Web Development Techdegree Graduate 14,523 Points

    I don't know what's wrong with this code

    Posted November 25, 2022 4:11am by Chiaki Yamada
    .a{fill-rule:evenodd;}techdegree seal-36
    Chiaki Yamada
    Front End Web Development Techdegree Graduate 14,523 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • aliyahchen
    aliyahchen
    5,829 Points

    I already use document.getElementById to select the input-phrase. however, the feedback is I didn't use it

    Posted August 16, 2022 2:39pm by aliyahchen
    aliyahchen
    5,829 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Ander Bil
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Ander Bil
    Full Stack JavaScript Techdegree Student 6,480 Points

    return the element containing the id?

    Posted August 4, 2022 1:19pm by Ander Bil
    .a{fill-rule:evenodd;}techdegree
    Ander Bil
    Full Stack JavaScript Techdegree Student 6,480 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Barbara Vega
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Barbara Vega
    Full Stack JavaScript Techdegree Student 19,486 Points

    Can someone please let me know what I'm doing wrong for this step? I'm getting a type error. Thanks!

    Posted May 13, 2022 9:56pm by Barbara Vega
    .a{fill-rule:evenodd;}techdegree
    Barbara Vega
    Full Stack JavaScript Techdegree Student 19,486 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Kakhaber Tchanturia
    Kakhaber Tchanturia
    7,762 Points

    Can't declare second variable.

    Posted February 3, 2022 2:29am by Kakhaber Tchanturia
    Kakhaber Tchanturia
    7,762 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Ronnie Hodges
    Ronnie Hodges
    5,812 Points

    const input = document.getElementById(`input-phrase`);

    Posted December 13, 2021 4:51am by Ronnie Hodges
    Ronnie Hodges
    5,812 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Seth Look
    Seth Look
    15,598 Points

    nothing works

    Posted December 1, 2021 11:31pm by Seth Look
    Seth Look
    15,598 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Oleksandra Smith
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Oleksandra Smith
    Front End Web Development Techdegree Student 9,361 Points

    Next, declare a new variable named input. Point the variable to the input element with the ID input-phrase. Use the meth

    Posted November 9, 2021 1:16am by Oleksandra Smith
    .a{fill-rule:evenodd;}techdegree
    Oleksandra Smith
    Front End Web Development Techdegree Student 9,361 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Arya G
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Arya G
    Full Stack JavaScript Techdegree Student 10,503 Points

    Declare a variable named button. Assign the variable the <button> element with the ID btn-phrase. Use the method that re

    Posted November 4, 2021 5:30am by Arya G
    .a{fill-rule:evenodd;}techdegree
    Arya G
    Full Stack JavaScript Techdegree Student 10,503 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    2 Answers

  • Alex Zhou
    Alex Zhou
    11,943 Points

    Anyone know why I keep on getting "Bummer: Cannot read property '1' of null"?

    Posted October 21, 2021 2:06pm by Alex Zhou
    Alex Zhou
    11,943 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Shine Browning
    Shine Browning
    2,304 Points

    Help please. I'm stuck on Task 2 and can't get the answer right.

    Posted October 12, 2021 1:23pm by Shine Browning
    Shine Browning
    2,304 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    3 Answers

  • Kelsey Donegan
    Kelsey Donegan
    3,342 Points

    Is step 1 not exactly the same as step 2?

    Posted August 25, 2021 7:34pm by Kelsey Donegan
    Kelsey Donegan
    3,342 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    1 Answer

  • Ricky Redman
    Ricky Redman
    7,520 Points

    I'm confused about this challenge, is the id entered the into a method?

    Posted August 12, 2021 11:26pm by Ricky Redman
    Ricky Redman
    7,520 Points
    • JavaScript
    • JavaScript and the DOM
    • Getting a Handle on the DOM
    • Select by ID

    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