jQuery:Selector selector1,selector2,selectorN

Overview

Selects the combined results of all the specified selectors. You can specify mutilple selectors, and combined the selected elemets to one result.

Parameter

selector1Selector

Any valid selector.

selector2Selector

Another valid selector

selectorNSelector

As many more valid selectors as you want.

Demo

Description:

to find the elements that match any of these three selectors.

HTML code:
<div>div</div>
<p class="myClass">p class="myClass"</p>
<span>span</span>
<p class="notMyClass">p class="notMyClass"</p>
jQuery code:
$("div,span,p.myClass")
Result:
[ <div>div</div>, <p class="myClass">p class="myClass"</p>, <span>span</span> ]

Leave a Reply

Your email address will not be published. Required fields are marked *