Duplicar posible:
Finding whether the element exists in whole html pageisset en jQuery?
me gustaría hacer algunas cosas:
HTML:
<span id="one">one</span>
<span id="two">two</span>
<span id="three">three</span>
JavaScrip t:
if (isset($("#one"))){
alert('yes');
}
if (isset($("#two"))){
alert('yes');
}
if (isset($("#three"))){
alert('yes');
}
if (!isset($("#four"))){
alert('no');
}
VIVO:
¿Cómo puedo hacer eso?
¿Qué debe establecerse en estos tramos? –
¿Qué significa 'isset'? El 'lapso 'tiene algo de contenido? ¿Existe? –