Вопрос

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