Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery:检查tr'的长度;里面是什么_Jquery - Fatal编程技术网

jQuery:检查tr'的长度;里面是什么

jQuery:检查tr'的长度;里面是什么,jquery,Jquery,我有这个我需要重写: if( $('tr.notification:visible').length == 0 ) { 因此,它检查它所在的表的长度是否为==0。我不想指定表的id,因为我希望它能在所有表上工作 $(this)是表内和tr内的class.removeAction 我使用了.notification,因为表中的所有tr都有类通知。但是我有更多的表,tr有class.notification,所以不能使用它,否则它可以正常工作 因此,表.removeAction在内部,其长度=

我有这个我需要重写:

if( $('tr.notification:visible').length == 0 ) {  
因此,它检查它所在的表的长度是否为==0。我不想指定表的id,因为我希望它能在所有表上工作

$(this)是表内和tr内的class.removeAction

我使用了.notification,因为表中的所有tr都有类通知。但是我有更多的表,tr有class.notification,所以不能使用它,否则它可以正常工作

因此,表.removeAction在内部,其长度==0,然后是alert('yes')


我该怎么做呢?

那么您有一个表,它有一个class
removeAction
,是在表上还是在表中的某个地方?你想从中得到
,它有
通知类?
if( $(this).closest('table').find('tr.notification:visible').length == 0 ) {