(the error is "elem has no properties" in the jquery js)


debussy007 wrote:
> 
> I tried :
> if( ! $('#tooltip') ) {
> ...
> }
> 
> it gives me a javascript error if I add this :(
> 
> 
> 
> 
> 
> Eridius wrote:
>> 
>> not sure, this is untested but might work(not sure what jQuery return if
>> nothing is found)
>> 
>> if($('#id'))
>> {
>>     //it exists
>> }
>> else
>> {
>>     //it does not
>> }
>> 
>> debussy007 wrote:
>>> 
>>> Hi,
>>> 
>>> what is the best way in jquery to check wether an id exists ?
>>> 
>>> Thank you for any kind help !!
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/check-if-an-id-exists-tp14488007s27240p14488143.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to