jQuery Tutorial Tutorials - jQuery Multi-selector

jQuery Multi-selector

The Multi-selector selects the combined results of all the specified selectors.The matched elements will be in document order.
Only one is reserved for duplicate elements.

jQuery Multi-selector Syntax

$('S1,S2,S3');

S1,S2,S3 are any valid selector,and you can specify any number of them.

jQuery Multi-selector Examples

In following example,when the user click on the button,
A red border will be added to all elements which match with specified selectors.

example:Select elements using jQuery Multi-selector
Try now
selector $('span') and $('.pink') will match the same element <span class="block blue">block three</span>, Multi-selector keep one only when combining the results.

Date:2019-06-09 01:49:13 From:www.Lautturi.com author:Lautturi