我有一些表格,我只需要保留一些內容在此表中,所以我有這個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在如果
是什麼TRUC ??? – writeToBhuwan
這是我的var與 – Valinor
裏面的表可能dublicate:http://stackoverflow.com/questions/1962247/jquery-get-all-divs-which-do-not-have-class-attribute –