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
marc ohlsson
Courses Plus Student 8,045 Pointsintro code challenge
$("a").before("<span>This is a link:</span>").click("function{}"); It bummers out telling me to pass a $("a"),
Should this work, still stuck. does the .click function look ok, or should i start a new line. still stuck. and I have <span> included, it wont print in the forum
2 Answers
James Barnett
39,199 PointsI noticed 2 issues with the code you posted, here are some hints to point you in the right direction.
- Function declarations require parenthesis.
- Since function declarations aren't strings, so they shouldn't be enclosed in quotes
marc ohlsson
Courses Plus Student 8,045 Pointsso I add .click(function(){}); dropping the quotes as to NOT creating a string as the anonymous function
James Barnett
39,199 PointsThat looks about right
marc ohlsson
Courses Plus Student 8,045 PointsThanks, I do have to run but will try this in afew hours. will keep in touch and again thanks. Marc
James Barnett
39,199 PointsDrop a comment in this thread and let us know how it worked out.
marc ohlsson
Courses Plus Student 8,045 Pointsworked out great, I have moved on thanks to your support.
Thanks, Marc
James Barnett
39,199 PointsJames Barnett
39,199 PointsRegarding your code that doesn't print in the forum. The forum uses markdown to correctly format code, check out this thread on how to type code in the forum for some examples.