I know that to filter an element with an atttribute called attrName which has value attrValue I do:
filter("[attrName='attrValue']")
but looking at the docs http://api.jquery.com/category/selectors/ I can't see an option to select all elements s.t. attrName>attrValue
Will this work
filter("[attrName>'attrValue']")
ID and Element selector are the fastest selectors in jQuery.
The id selector uses the id attribute of an HTML element to select a specific element. The id of an element is unique within a page, so the id selector is used to select one unique element! To select an element with a specific id, write a hash (#) character, followed by the id of the element.
jQuery uses CSS selector to select elements using CSS. Let us see an example to return a style property on the first matched element. The css( name ) method returns a style property on the first matched element. name − The name of the property to access.
You can do this using the function overload of .filter()
, like this:
.filter(function() { return $(this).attr("attrName") > "someValue"; })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With