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 trialVic Mercier
3,276 PointsWhy do we need to use *?
I'm confusing.What would it do without *?
$('a').not('[href*="my-domain.com"]').attr("target", "_blank");
1 Answer
Steven Parker
231,269 PointsI'm going to guess that you intended to show "*=
" in the attribute selector. That symbol means "contains", so it would match any value that contained the string shown. But just a plain "=
" symbol means "equals", and would only match if the value was exactly the same as the string shown.
Steven Parker
231,269 PointsSteven Parker
231,269 PointsAre you asking about an asterisk symbol ("*")? I don't see one in that line of code, perhaps it's being lost because the code is not formatted.
Always use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. Or watch this video on code formatting.