我不确定如何使用 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/