I’m trying to do some filter with divs. I have several divs:
<div data-areafrom="19" data-areafrom="24" class="sgmt">Div 1</div>
<div data-areafrom="30" data-areafrom="44" class="sgmt">Div 2</div>
<script>
$paramFrom = 0;
$paramTo = 20;
$('.sgmt').filter(function() {
return $(this).data('areafrom') >= $paramFrom && $(this).data('areato') <= $paramTo;
}).addClass("sgmt-show");
</script>
And i need to check if any number between data-areafrom=”19″ and data-areafrom=”24″ is between paramFrom and paramTo. How ca i do that?
Sergei Shumailov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.