可能重複:
Finding whether the element exists in whole html pageisset in jQuery?
我想做出出頭:
HTML:
<span id="one">one</span>
<span id="two">two</span>
<span id="three">three</span>
的javascrip牛逼:
if (isset($("#one"))){
alert('yes');
}
if (isset($("#two"))){
alert('yes');
}
if (isset($("#three"))){
alert('yes');
}
if (!isset($("#four"))){
alert('no');
}
LIVE:
我怎麼能作出這樣的?
什麼都要被設置爲這些跨度? –
isset是什麼意思? 'span'有一些內容?它存在嗎? –