<div id="example">
<div id="test"></div>
</div>
<div id="another">Blah</div>
Quiero configurar $('#another').hide()
pero sólo si #example
contiene un elemento secundario denominado #test
, es esto posible? Parece que sería.Comprobar si el elemento principal contiene cierto elemento secundario usando jQuery
'tamaño()'. ¡No he visto eso en mucho tiempo! 'length' ftw. – elclanrs
¿Debería llamarse 'contains' con un elemento DOM como parámetro y no como un objeto jQuery? http://api.jquery.com/jQuery.contains/ – mxro