Olası Çoğalt:jQuery'de mi?
HTML:
<span id="one">one</span> <span id="two">two</span> <span id="three">three</span>
JAVASCRİP i birşeyler yapmak istiyorum
Finding whether the element exists in whole html page
t:
if (isset($("#one"))){
alert('yes');
}
if (isset($("#two"))){
alert('yes');
}
if (isset($("#three"))){
alert('yes');
}
if (!isset($("#four"))){
alert('no');
}
CANLI
: bunu nasıl yapabilirim?$.fn.exists = function() { return this.length > 0; };
// later ...
if ($("#id").exists()) {
// do something
}
ne olmalıdır bu açılımlara mı ayarlanmalı? –
'isset' anlamı ne anlama geliyor? 'Span' bazı içerik var? Var? –