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

JavaScript

intro 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

Regarding 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.

2 Answers

I 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

so I add .click(function(){}); dropping the quotes as to NOT creating a string as the anonymous function

That looks about right

Thanks, I do have to run but will try this in afew hours. will keep in touch and again thanks. Marc

Drop a comment in this thread and let us know how it worked out.

worked out great, I have moved on thanks to your support.

Thanks, Marc