Multiple selectors at once (Should know)

This section will teach you how to use more than one selector, and it doesn't matter if they're of the same or different kind, in a single call. The goal of the task is to print on the console the length of the retrieved collections.

How to do it...

This task can be achieved by performing the following instructions:

  1. Create a copy of the template.html file and rename it as multiple-selectors-at-once.html.
  2. Inside the <body> tag, add the following HTML markup:
    <h1 id="title" class="bold red">Multiple selectors at once</h1> <div id="container" class="wrapper"> This example shows you the use of Multiple selector. <p id="description" class="red">Using it you'll have better performance, so adopt it when possible.</p> ...

Get Instant JQuery Selectors now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.