5. Harnessing Advanced Selectors

In each of the exercises to this point, you’ve mostly used jQuery’s basic selectors to identify elements you’ve wanted to work with. The basic selectors have worked well and will continue to serve most of your needs.

You’ve also used one of the more advanced selectors, an attribute selector. These types of selectors identify the element and then a particular attribute that the element has, such as $('a[href="foo.html"]). But there’s a lot more you can do with attribute selectors, such as selecting attributes that start or end with a particular value or contain a certain word. Many of the attribute selectors offer regular expression–like ...

Get jQuery and jQuery UI: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.