cal*_*ett 6 jquery integer numbers contains
选择不包含数字的元素的最佳方法是什么?
例如
$('div').not(":contains('1')").not(":contains('2')").not(":contains('3')")...;
Run Code Online (Sandbox Code Playgroud)
对不起chad我说错了我的例子.
我已经选择了大约20个div,然后需要过滤掉那些不包含数字的div来将它们传递给函数.
我试过让你的例子像你一样工作
if($(this:+'regex(html, #^0-9]')).length <1 {
Run Code Online (Sandbox Code Playgroud)
但没有运气
不使用插件,您只需使用过滤器.
$('div').filter(function() {
return !/[0-9]/.test( $(this).text() );
});
Run Code Online (Sandbox Code Playgroud)