Jquery find div attribute value less or higher

I want to find all the attributes associated with a div that match a lower or higher numeric value.

it only worked on the value eq = 444 (example div [ref = 444], [ref = 333] ....)

var $ filterData = $ data.find ('div [ref = 444]');

but I want to compare find <444 (find the value of the div attribute less than <444) or> 444 (find the value of the div attribute above> 444) in the entire value of the div attribute

how to find or select all div attr values ​​less or higher thanks for everything

+3
source share
1 answer

, - , , . filter:

$filteredData= $data.find('div').filter(function() {
    return parseInt($(this).attr('ref'), 10)<444;
});

( ref? HTML, . HTML, , HTML5 data-. , className, , , .)

+3

Source: https://habr.com/ru/post/1772301/


All Articles