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 Using jQuery Plugins Using a jQuery Carousel Explore Carousel Settings

John Wilson
John Wilson
11,739 Points

jquery plugin sticky "Email Us" class type email-text.

In the sticky jquery plugin lesson. Dave adds the email us feature to the sticky plugin. I understand everything he does except for the extra bit of code he adds at the end in the main.js file.

$(this).append(' <a href="mailto:email@website.com" class="email-text">Email us</a>');

why did he need to add a class "email-text"? and WHAT is that last "Email$nbsp;us" all about???

Alex Lewis
Alex Lewis
15,619 Points

The class is just a css class to style the "Email Us" text. the &nbsp; is just an html character entity for a blank space.

2 Answers

Alex answered it: "The class is just a css class to style the "Email Us" text. the   is just an html character entity for a blank space."

&nbsp is for non-breaking space. "email-text" is added for future, Dave delete the item later using this class as a selector.