jquery an div tags used in a ordered list

Posted by shan2on on Stack Overflow See other posts from Stack Overflow or by shan2on
Published on 2010-06-15T20:59:26Z Indexed on 2010/06/15 21:02 UTC
Read the original article Hit count: 163

Filed under:

hello everyone,

i'm not sure where my errors are lying but here is my scenario...

i have an un-ordered list in html that handles my main link bar...

    <ul id="navlist">

 <li><a href="/" id="current">home</a></li>

 <li><a href="#" id="search">search</a></li>

 <li><a href="#" id="users">login</a></li>    

</ul>

and what i want done is to call each id and have jQuery handle each and dislpay it where specified in my css file... for now, lets just ignore my "home" link...

here is a snippet of my inline jquery

$(document).ready(function()

{

$("a").click(function ()

{

      $("div#login").slideToggle("fast");

});

})

Now, whichever div i specify, it calls that ... however it will only call one div, using either from the un-orderd list, as mentioned above in the html.

My Goal is to call a search bar when search is clicked, and to call a login box when login is clicked.

to my knowledge (noob), i believe use an as a class, however that is what brings me here.

i believe my error is in my jquery and not my css, as stated above, either instance will be displayed when the jquery function calls either tag.

any help is greatly appreciated.

thanks in advance

shan2on

© Stack Overflow or respective owner

Related posts about jQuery