Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript and the DOM (Retiring) Making Changes to the DOM Modifying Elements

don't understand the question

Next, set the text content of the <a> element with the ID link to the value stored in inputValue.

Just dont understand the question.

var inputValue = document.querySelector("#linkName").value;
<!DOCTYPE html>
        <title>DOM Manipulation</title>
    <link rel="stylesheet" href="style.css" />
        <div id="content">
            <label>Link Name:</label>
            <input type="text" id="linkName">
            <a id="link" href="https://teamtreehouse.com"></a>
        <script src="app.js"></script>

6 Answers

Hi Jason!

This passes both tasks:

var inputValue = document.querySelector('#linkName').value; // Task 1

document.querySelector('#link').textContent = inputValue; // Task 2

I hope that helps.

Stay safe and happy coding!

Think I'm going to go back to the very beginning of JavaScript and the DOM and start again. Unfortunately having many problems. I got a feeling it'll take me 3 months to get comfortable with this module.

Hi Jason!

Don't feel bad.

Sometimes it does help to review material.

I don't know if it helps, but I always keep several tabs open in my browser with peripheral reference information when doing any tutorials.

Such as:




https://www.youtube.com/user/derekbanas (His videos are awesome - he talks fast, so you don't fall asleep!?! LOL)

And, of course, I Google-search related topics constantly.

Stack Overflow is handy, too!

I hope that helps.

Stay safe and happy coding!

Hi Jason!

I also study some here:


(Why not? It's FREE)

Sometimes it's better than Treehouse, other times not-so-much, but at least it's a slightly different perspective and will inevitably cover some things Treehouse doesn't.

I have 4 certifications through freeCodeCamp, so far.

I hope that helps.

Stay safe and happy coding!

Thank you very much this will help a lot, I like treehouse but yeah I need extra sources to learn from thanks again Peter Vann!

Does jQuery replace some of the difficulty with what I'm learning in the DOM?

At the moment I am only studying the JavaScript track, so what's at the end of it? I was doing the front end web development but as JavaScript is really hard I thought about it and switched to it. However I found no information about the degree/exam and I dont know if there is a test or certificate at the end of my JavaScript track? As time goes on and I struggle through, this concerns me a little.

I know these questions are away from the norm, I hope you dont mind my asking.

Hi Jason!

Ask away!

I have a philosophy that the only stupid question is one that is never asked!?!

To get certificates through Treehouse, I think you need to do a Tech Degree program (which is a lot more expensive per month - $199.00/mo.). But you can get certifications through freeCodeCamp (for FREE), too. I also take many Udemy courses, as well. I watch a lot of YouTube videos, too (Derek Banas' videos are INCREDIBLE)!!!

I just do the regular Treehouse courses (not the Tech Degree) and have off-and-on for the last four years (and now that I am a moderator, I have the Courses Plus plan - free to me, but a $49.00/month value). I just passed the 30,000 point mark.

By the way, my ex-girlfriend got a Tech Degree program certificate (and around 22,000 points) but is not much of a real coder. She couldn't code her way out of a paper bag, in my opinion (part of why she is my "Ex", actually!?! LOL). In other words, she got the degree, but her heart just wasn't in it. My dad was an electrical engineer and my brother was a lifelong Java programmer, so it's in my blood.

JQuery is great to know, so I certainly recommend learning it. It has its place and at times is the right tool for the job.

But so does "vanilla Javascript" (regular JavaScript is absolutely ESSENTIAL TO KNOW)!!!

I think anyone serious about web development should have a very strong foundation in HTML, CSS, JavaScript, and SQL (databases).

I recommend plowing through every course you can on those four first (HTML5, CSS3, ES6, MySQL, and MongoDB, too)!?!

And I highly recommend PHP (server-side programming and WordPress), too, and Python (I recently started learning Python and LOVE IT)!!!

Eventually, it would benefit you to move into frameworks, such as React, Django, and Angular, but I would wait until you have absolutely exhausted any/all courses on the first four foundational languages.

Eventually, it would be good to familiarize yourself with some graphics, tools as well, such as Photoshop, Illustrator, and/or Gimp (and a video editing package, too, such as Final Cut Pro X).

Also really get to know a few great code editors, such as VSCode and Atom (and Sublime and Brackets, too) - inside and out. Learn all the keyboard shortcuts and as much about the various available extensions, too.

I know it all sounds like a lot but focus on the journey and not the destination.

Hopefully, you will come to enjoy it and even LOVE IT as I have!

BTW, I can't remember if I shared this with you before, but it's something fun/funny (to me, anyway!?!):

https://codepen.io/petrovnikov/full/MXxQPx (LOL) (Made with React and Redux, actually!?!)

It's my take on the classic "Simon Game":


I hope that helps.

Stay safe and happy coding!

And again, feel free to ask anything - that's what we're here for!


Wow you certainly covered my questions and more! Thank you! I am using VScode a lot and I find it better in many ways, and its free! For the moment I really want to focus on html, CSS and JavaScript, but I am so interested with what you have said that I am printing your response out as a rough guide to me as you would appreciate I have come from a codeless family :-) and have no course direction... treehouse though has got me started and am always thankful for that (even with uphill struggle through JavaScript) :-)

Talking of JavaScript I was on the JavaScript only course and so I found the DOM really hard, my friend says do the Web Development Course because it has CSS selectors track before the DOM track - which would help me a great deal with selectors in the DOM so I've switched to Web Development Course.

I have also felt with jobs the way they are a certain amount of rush learning to get knowledge and improve my CV however rush learning has added to my problems and added stress too, like you say I was focusing on the destination and worrying about how to get there in a short time, and being naive to the quantity of work to do first, however no matter whatever happens I will continue my studies and concentrate on the journey.

I am thinking to learn as much as I can before even being interested in paying $199 a month to do the exam, I'm sure its a wise decision. At the moment I'm downloading the lesson videos and workspaces into a Properly named set of files and folders so I can quickly access material as a reference for now and in the future.

Again you have gone above and beyond with your replies and it's very very much appreciated, right off I go into the coding arena :-)

You be safe too. Jason

Hi Jason!

One thing I left out is Node.js

Are you familiar with it?

Node.js was created about 8 years ago.

Node.js created something of a revolution. What it did primarily is make it possible to run JS on the SERVER SIDE and not just in the browser (client-side). (Which had never been done before!?!) What that meant is that it is now possible to write FULL STACK WEB APPLICATIONS entirely with JavaScript (even the database code could be all JavaScript, if you used something like MongoDB on the backend).

Many modern frameworks, such as React and Angular all supersets/libraries based on Javascript.

What that told me was that, as a result, JavaScript was not going anywhere (meaning it will not be replaced anytime soon). It is here to stay. As a result, knowing it well - inside and out and upside-down, backward and forwards is VERY WORTHWHILE!!!

Here is a presentation by the guy who created it:


The MEAN stack is a. good example:




Again, I hope that helps.

Stay safe and happy coding!

One more silly sidebar:

I'm pretty sure that Ryan Dahl (the Node.js inventor from the video) was the inspiration for the main character on HBO's Silicon Valley by Mike Judge. That's my theory, anyway. LOL