[jQuery] Re: Display a div if and id is found

2008-10-17 Thread MorningZ
if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); } On Oct 17, 1:47 pm, Taylor [EMAIL PROTECTED] wrote: Is there a simple way with jQuery to find a div with a specific id, and display a different div if the id is found?  I know this may not be the best way to accomplish

[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Mauricio (Maujor) Samy Silva
Another approach: if ( $('#FirstDiv').length 0 ) { $('#SecondDiv').show(); } -- De: MorningZ [EMAIL PROTECTED] if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); }

[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Taylor
Thank you. They both worked great. On Oct 17, 3:09 pm, Mauricio \(Maujor\) Samy Silva [EMAIL PROTECTED] wrote: Another approach: if ( $('#FirstDiv').length 0 ) { $('#SecondDiv').show(); } -- De: MorningZ [EMAIL

[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Ryura
Actually, you don't need the 0 part. 0 evaluates to false anyway, so just if($(#whatev).length) works fine On Oct 17, 4:09 pm, Mauricio \(Maujor\) Samy Silva [EMAIL PROTECTED] wrote: Another approach: if ( $('#FirstDiv').length 0 ) { $('#SecondDiv').show(); }

[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Klaus Hartl
Here's another trick to accomplish it: $('#first, #second').eq(1).show(); --Klaus On 18 Okt., 00:00, Ryura [EMAIL PROTECTED] wrote: Actually, you don't need the 0 part. 0 evaluates to false anyway, so just if($(#whatev).length) works fine On Oct 17, 4:09 pm, Mauricio \(Maujor\) Samy