Amit Shah Amit Shah - 1 year ago 74
jQuery Question

jQuery: Exclude those td, having child element Label with class "control-label"

I am trying to select all td in document using jQuery,excluding those td which have child element label with class name "control-label".

<td width="30%"><label class="control-label">IP Address</label></td>

I tried:

jQuery("table td").not("table td > label.control-label").attr('width','');

Answer Source

Try this selection:

$('td:not(:has(> .control-label))');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download