tomuky tomuky - 5 years ago 218
Javascript Question

JQuery Select Attribute Range

Kind of like this:

$("[day=5]").html('hi');


But for a range like this:

$("[day>5]").html('hi');


Because I want that to work so bad.

Answer Source

You can do this using the function overload of .filter(), like this:

$("[day]").filter(function() {
  return +$(this).attr("day") > 5;
})
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download