问题描述:

This question already has an answer here:

  • jquery does div contain children of a certain class

    2 answers

网友答案:

try if($(this).children('span').length==0)

网友答案:
if ($(this).is(':empty')) {...}

or:

if (!$(this).has('span')) {...}

or just:

if (!$(this).children().length) {...}
相关阅读:
Top