Pregunta

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.

¿Fue útil?

Solución

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');
}

Otros consejos

use:

if($('td select').length){
   //select exists
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top