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! While you're at it, check out some resources Treehouse students have shared here.
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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Sura Salman](https://uploads.teamtreehouse.com/production/profile-photos/790992/micro_Arctic_Fox2.jpg)
Sura Salman
7,204 PointsOn line 5 of app.js, use the classList property on the anchor to add a new class of "selected" to it.
What is the answer of it ?
10 Answers
![Sreng Hong](https://uploads.teamtreehouse.com/production/profile-photos/220202/micro_srenghong.jpg)
Sreng Hong
15,083 PointsHi Sura
Here is the answer:
anchor.classList.add("selected");
![chaz](https://uploads.teamtreehouse.com/production/profile-photos/4383842/micro_2zBWqiPr.jpg)
chaz
25,372 Points.add()
this isn't covered at any point during the lesson. The lack of continuity between the lesson project and code challenge projects is Treehouse's greatest weakness.
![Sura Salman](https://uploads.teamtreehouse.com/production/profile-photos/790992/micro_Arctic_Fox2.jpg)
Sura Salman
7,204 PointsThnk you mate. It works fine for me. I just wanted to save myself from javascript. I understood nothing from Andrew and Jim. I will continue on PHP and CSS.
![Sreng Hong](https://uploads.teamtreehouse.com/production/profile-photos/220202/micro_srenghong.jpg)
Sreng Hong
15,083 PointsYour welcome
![lukebiggerstaff](https://uploads.teamtreehouse.com/production/profile-photos/447492/micro_10428622_10103585297477150_5102043154378110766_n.jpg)
lukebiggerstaff
27,534 PointsSura,
Make sure that you're trying to figure these out on your own, google everything that you're having trouble with and you will learn much faster.
That being said, anchor.classList.toggle('live'); will get the job done.
Luke
![Harry Beckwith](https://secure.gravatar.com/avatar/3cb39a70206e7146a21e7159d9e79cbd?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Harry Beckwith
13,452 PointsFor jQuery and basic javascript projects i would recommend https://www.udemy.com/projects-in-javascript-jquery/ really valuable lessons learnt!
![Sura Salman](https://uploads.teamtreehouse.com/production/profile-photos/790992/micro_Arctic_Fox2.jpg)
Sura Salman
7,204 PointsTHNk you. On about line 9 in app.js, use classList to toggle the "live" class on the anchor element. ?
![Sreng Hong](https://uploads.teamtreehouse.com/production/profile-photos/220202/micro_srenghong.jpg)
Sreng Hong
15,083 PointsI think it's simply the same. All you have to do is read the instruction clearly.
They said use classList to toggle the live class on the anchor element, so you can use the same answer from task 1 of 2 to change the keyword add to toggle and the class selected to live.
Hope this helps.
![Sura Salman](https://uploads.teamtreehouse.com/production/profile-photos/790992/micro_Arctic_Fox2.jpg)
Sura Salman
7,204 PointsI did it mod's can clear my posts.Thats all and im done.
![Tony Brackins](https://secure.gravatar.com/avatar/91009e6a51dccc0d4664ab8a38d8412a?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Tony Brackins
28,766 PointsHey Sura,
These classes from Jim and Andrew were EXTREMELY difficult. With that said, don't give up! You will get a little piece from each class and can do learning in other places as well.
Here's a good course that I found in the forums that explains a little better: https://www.youtube.com/watch?v=LsY2PsPKckU&feature=youtu.be
Josephine Mukuya
5,911 Pointssure,, thanks guys, at least i know its not me alone,,i didnt get anything from Andrew,,his approach is something,, will try understand from other sources.
![Rich Braymiller](https://secure.gravatar.com/avatar/d320f10c14c262b945046d2899edbca3?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Rich Braymiller
7,119 PointsAndrew is awful!
![Harry Beckwith](https://secure.gravatar.com/avatar/3cb39a70206e7146a21e7159d9e79cbd?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Harry Beckwith
13,452 PointsThe lessons are very technical and specific to that certain problem. But to be honest i would not know how to apply it to another problem, just from these videos. Saying that i have learnt a few things. I am thinking of buying a text book to try and understand javascript applied on websites.... any one know of a good one?
![David Hughes](https://secure.gravatar.com/avatar/ed81d445988a663506496629eb15255c?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
David Hughes
5,063 PointsI have to agree with some comments from others. I have some understanding of JavaScript before starting this course. And though the course DOES introduce us to several new ways of performing tasks, they aren't really explained. I spent a lot of time reviewing my own code and entering really long comments to better explain what was not being explained in the videos.
In a way this was an effective way to learn. But there were many times that I was entirely lost. I think the course just needed some additional clarity. It is was really difficult to follow how
addButton.onclick = addTask;
triggered addTask
, which would then createNewTaskElement
, and pass in a variable that we defined globally at the start of the lesson.
As I said, I did learn from this, but I feel that I could have learned even more had each step been explained a bit more clearly.
With all of that being said(I think I'm the third person to use that phrase on this thread) TreeHouse courses have been amazing thus far.
![Herman Morales](https://uploads.teamtreehouse.com/production/profile-photos/6865612/micro_firebseme.jpg)
Herman Morales
8,831 Pointsthis is the answer anchor.classList.toggle('live');
Jeff Busch
19,287 PointsJeff Busch
19,287 PointsLet's see the code you have tried.