Can I Pass an array into jquery attr for one property, such as follow
$("th[id={x,y}]")
it look like “where in” condination at SQL. My wants such as it, $(“th[id={x,y}]”) is th’s id equal one of these? I want to ask it! Do you use any where-in condition in sql.. My wants like it.
[EDIT]
the question has been modified to clarify what he wants, so I’ve removed the inapplicable parts of my answer…
JQuery (and CSS) allows you to use multiple selectors together:
For example:
…will select all elements in your page with either of your possible
idvalues.Alternatively, if you only want to find them within
$(this), you would use thefind()method:Hope that answers you’re question.
Depending on the values you’re searching for, you may also be interested in more advanced attribute selectors. For example, if your
x,yandzoptions all begin with the same string, you could use the attribute prefix selector:or if they all contain a particular word:
there are a number of possible options; that should give you a start, but see the JQuery manual for more information: http://api.jquery.com/category/selectors/