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!
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
Aydın Çağrı Dumlu6,573 Points
No it is not for removing elements. This method is used for select the elements that do not match the criteria are returned from the selection.
David Kanwisher9,751 Points
Let's say you have 5 list items on your HTML page:
<li>item 1</li> <li>item 2</li> <li>item 3</li> <li id="special">item 4</li> <li>item 5</li>
If you were to type:
it will select all 5 of your list items
so in turn if we were to say
it would give all 5 of our list items bold text
if we said
it would return 4 out of the 5 list items, but it would not include the one with the id of "special"
Using our previous example we can chain these to say:
and now all EXCEPT number 4 have bold text