I know that to filter an element with atttribute named attrName, which has the value attrValue, I do:
filter("[attrName='attrValue']")
but looking at the documents http://api.jquery.com/category/selectors/ I donβt see a choice to select all the elements st attrName> attribute value
Will it work
filter("[attrName>'attrValue']")
You can do this using the overload function .filter() , for example:
.filter()
.filter(function() { return $(this).attr("attrName") > "someValue"; })
JQuery.filter () solution:
$("selector").filter(function() { return $(this).attr("my-attr") > 123; });
Be careful if you play with integers, make sure you use parseInt() .
parseInt()
$("selector").filter(function() { return parseInt($(this).attr("my-attr")) > 123; });