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
Dina Hafez
14,454 PointsCan someone tell me why onclick is not working?
Hello,
I have checked my code around 4-5 times and I can't see anything wrong with it or maybe I haven't notice it yet.
When I click the buttons they work but in a weird way, not the way it suppose to appear.
Here is my workspace: https://teamtreehouse.com/workspaces/31351262
Thank you.
5 Answers
Steven Parker
243,253 PointsAhh, I see what you mean. In song.js, on line 11, there should be a space inside the quote before the word "class". Otherwise when combined with the tag name, it changes it to "liclass" (not a valid tag name) instead of just adding a class attribute.
There's a similar space missing on line 11 of movie.js.
Dina Hafez
14,454 PointsOh! my bad.
Thank you for the tutorial. Here it is https://w.trhou.se/4hql3ia2ql
I continued the prototypal inheritance but the problem I think is from the beginning the clicking buttons.
Steven Parker
243,253 PointsI tried out your workspace and the buttons all seem to work for me.
Perhaps you could explain what you mean by "work in a weird way"?
Dina Hafez
14,454 PointsYes, sure.
So when the instructor clicks on play you have like a highlight color on the song and then it moves to next one when he clicks next but that doesn't happen here. From the functionality side it works but it doesn't display in the same way as in the tutorial. When I click play the first song decreases the size of the box model for the current song in a really weird way, it shrinks in a really small height and it is centered as well.
Dina Hafez
14,454 PointsI can't believe a space would ruin the whole app appearance!
It is so hard to notice something like that but yes I totally understand what you mean.
Thank you so much for your help :)
Steven Parker
243,253 PointsSteven Parker
243,253 PointsYou can't share a direct URL to your workspace, it's temporary and only exists while you are using it.
But you can use the snapshot function in the workspace and provide the link to that.