Pass an array into jquery attr(), for one property -


can pass array jquery attr 1 property, such follow

$("th[id={x,y}]") 

it "where in" condination @ sql. wants such it, $("th[id={x,y}]") th's id equal 1 of these? want ask it! use where-in condition in sql.. wants it.

[edit] the question has been modified clarify wants, i've removed inapplicable parts of answer...

jquery (and css) allows use multiple selectors together:

for example:

$('[id=x], [id=y], [id=z]') 

...will select elements in page either of possible id values.

alternatively, if want find them within $(this), use find() method:

$(this).find('[id=x], [id=y], [id=z]') 

hope answers you're question.

depending on values you're searching for, may interested in more advanced attribute selectors. example, if x, y , z options begin same string, use attribute prefix selector:

$('[id|=prefix]') 

or if contain particular word:

$('[id~=word]') 

there number of possible options; should give start, see jquery manual more information: http://api.jquery.com/category/selectors/


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -