How do I find all elements with a specific 'name' attribute using jQuery -


I want to find all the elements on my page that have the 'name' or 'name' attribute with 'x' or 'y' P>

If anything is named 'x' or 'y' in the name attribute, then .yepItHasXorY

It seems like a simple thing to say that ID or How to search on the basis of the class but not the name attribute ...

You can use it Do:

  $ ("[name * = x], [name * = y]"). AddClass ('yepItHasXorY');  

However, I will add an element type, over there, or maybe : input you are only viewing the elements that you care about (otherwise it is more Expensive selector).


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -