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
Post a Comment