gaffcz
gaffcz

Reputation: 3479

jQuery - find the specified components on the form

I'm searching for inputs on my form and adding them to the inputs variable:

var inputs = $(this).parents("form").eq(0).find(".input:visible:enabled");

How can I extend this search of the other components like select. So, add the inputs and selects in the order in which they were found on the form?

Something like

var inputs = $(this).parents("form").eq(0).find(".input:visible:enabled OR .select");

Upvotes: 2

Views: 191

Answers (2)

dvir
dvir

Reputation: 5115

You can separate selectors with a comma (,)

jQuery Multiple Selector

Upvotes: 1

thecodeparadox
thecodeparadox

Reputation: 87073

$(this).parents("form").find(".input:visible:enabled, .select");

Multiple selectors will be separated by comma(,).

For more see here

Upvotes: 1

Related Questions