How to filter by (attr >= value)?

How to filter by (attr >= value)?

Brief overview: This is a calendar system in day view (displaying minutes down the left side) and I'm using divs for each time slot. I'm trying to only select timeslots after a certain timestamp.

Example:

  1. <div class="rc-timeslot" data-time="1265040000"></div>
  2. <div class="rc-timeslot" data-time="1265040300"></div>
  3. <div class="rc-timeslot" data-time="1265040600"></div>
I'd like to only grab timeslots that match:
  1. .attr("data-time") >= 1265040300
How would I go about this efficiently? I know I can do this:
  1. $("div.rc-timeslot").each(function() {
  2.     if($(this).attr("data-time") >= 1265040300) {
  3.         // add to valid selections here
  4.     }
  5. });
...but that seems resource-heavy. Suggestions?

    • Topic Participants

    • jamon