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 Build an Interactive Website Introduction to jQuery Using jQuery to Manipulate Elements and Add Behavior

Brandon Battles
Brandon Battles
3,315 Points

Code Challenge - Introduction to jQuery

$(".error").show();

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

Before every link add this HTML: <span>This is a link;</span>

I must be missing something, because with this markup it continues to return the error that Task 1 is no longer passing. Help, please.

5 Answers

Wade Christensen
STAFF
Wade Christensen
Treehouse Teacher

You need to place your html inside quotation marks.

$("a").before('<span>This is a link: </span>');

Also, notice the space between the colon at the end of the word "link" and the </span>

Hey Brandon,

<span>This is a link:</span> must be between double quotes:

```"<span>This is a link:</span>"

Louis Otto
Louis Otto
23,264 Points

Hi Sacha, that won't work, the quotations need to be outside of the <span> tags themselves

Thx Louis, I noticed my mistake. I modified it :p

Louis Otto
Louis Otto
23,264 Points

Remember to wrap in quotation marks, you're very close but you just need to wrap the <span> tags in " like this:

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

$(".error").show(); $("a").before("<span>This is a link: </span>");

U have forgotten the "DOUBLE QUOTE" marks from the string in the before method.

Brandon Battles
Brandon Battles
3,315 Points

Awesome! Thank you all so much for your help!