How can I check if there is a select box inside a td

if(there is select box inside td){
alert('yes');
}else{
alert('no');
} 

How can I achieve this?

Thanks in advance.

有帮助吗?

解决方案

Try

if ($('td select').length) { // or el.find('select').length; in case of cached selector
    alert('yes');
    $('td:has("select")').remove('select'); //to remove select
} else {
    alert('no');
}

其他提示

use:

if($('td select').length){
   //select exists
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top