2013-06-04 38 views
0

我有一些表格,我只需要保留一些内容在此表中,所以我有这个jQuery也没有选择为“无级”

$(truc).find('tr').each(function(lig) { 
     if (lig != 0 && (!$(this).children(':first').not('')) && (!$(this).children(':first').hasClass('main-title')) && (!$(this).children(':first').hasClass('top-top-title'))) { 
      $(this).remove(); 
     } 
     ; 
    } 

我需要为(!$(this).children(':first').not(''))因为帮助我需要选择其中的第一个孩子没有类(甚至没有一个空类)的线,我不知道我需要哪些指令

编辑:我解决我自己女巫支票上$(this).children(':first')如果他们有一个属性类 $(this).children(':first').attr('class'),所以如果一个元素没有类,它不会“T在如果

+1

是什么TRUC ??? – writeToBhuwan

+0

这是我的var与 – Valinor

+4

里面的表可能dublicate:http://stackoverflow.com/questions/1962247/jquery-get-all-divs-which-do-not-have-class-attribute –

回答

0

进入Try

!$(this).children(':first').get(0).className 
+0

似乎没有工作,我有同样的结果。 – Valinor

0

检查属性,这样

(!$(this).children(':first').not('[class]'))