gpt4 book ai didi

javascript - jQuery(.filter) : how to use numerical range instead of . 长度 <#?

转载 作者:行者123 更新时间:2023-12-03 09:48:21 24 4
gpt4 key购买 nike

我不确定如何使用 0 到 159 等数字范围来代替 .length<3。非常感谢任何帮助。

$(document).ready(function() {
$('TD.green.center').filter( function(){ return $(this).text().length<3; } ) .parent().hide()
});

最佳答案

使用parseInt将字符串转换为整数。

$(document).ready(function() {
$('TD.green.center').filter( function(){
return parseInt($(this).text())<160;
}).parent().hide()
});

关于javascript - jQuery(.filter) : how to use numerical range instead of . 长度 <#?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30952093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com