[jQuery] Re: How to check is element exist

2007-12-05 Thread schellmax
You can use the length property of the jQuery collection returned by your selector: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_test_whether_an_element_exists.3F On 8 Okt., 13:19, zidoo <[EMAIL PROTECTED]> wrote: > if home some like this: > > $('').appendTo('body'); > > now when i

[jQuery] Re: How to check is element exist

2007-10-08 Thread Klaus Hartl
zidoo wrote: > if home some like this: > > $('').appendTo('body'); > > now when i create new element i need to check if that element already > exist, if exist focus, else create. I cant find in jquery > documentation isExist statement or something like that. > > Thanks. Try: var $div = $('#id