[jQuery] Re: How to check if a DIV with ID xyz exist?
As correct as 0 == false et 1..oo == true
Michel Belleville
2009/10/27 bc04Inc. <bc04inc@googlemail.com>
I have now found this one:
if ($('#toc').length) {
}
is this correct, too?
> > yavuz- Zitierten Text ausblenden -
On 27 Okt., 14:39, MorningZ <morni...@gmail.com> wrote:
> if (document.getElementById("xyz")) {
> // exists}
>
> else {
> // does not exist
>
> }
>
> or, if you must use jQuery for whatever reason (which would ultimately
> use the above anyways)
>
> if ($("#xyz").length > 0) {
> // exists}
>
> else {
> // does not exist
>
> }
>
> On Oct 27, 9:37 am, "bc04Inc." <bc04...@googlemail.com> wrote:
>
>
>
> > Hi,
>
> > how can i check if a DIV with the ID xyz exist?
>
> > thank you
>
> - Zitierten Text anzeigen -
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home