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


JQuery Code challenge. What am I doing wrong?

Here is the link to the challenge.


This is my code $("a").before("<span> This is a link: </span>")

it keeps saying "incorrect string passed into before"

Also why doesn't my return key work while trying to make this forum topic?

span tags were added it just for some reason doesn't show up on the forums.

3 Answers

Kevin Korte
Kevin Korte
28,148 Points

You need to make sure you include the span tags as part of the string you are passing into the before method.

No idea on the return key issue. Mine works.

Hey Kevin I did put the span tags in but when I write out my code here in the forums it hides the code.

Kevin Korte
Kevin Korte
28,148 Points

That's a good start. Try removing the space you have between the opening parenthesis and what should be the opening span tag.

Ron McCranie
Ron McCranie
7,837 Points

There should be a space after the semicolon, before the closing span tag.