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');
}
Вопрос
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
}