简体   繁体   English

jQuery选择属性范围

[英]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. 因为我希望它如此糟糕。

You can do this using the function overload of .filter() , like this: 您可以使用.filter()的函数重载来做到这一点,如下所示:

$("[day]").filter(function() {
  return +$(this).attr("day") > 5;
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM