Hey, u can use
$(this).next().toggle();

You should read Traversing section of jquery document, it describe
clearly similar methods(next,prev,siblings...)

On 16/02/2008, Daniele <[EMAIL PROTECTED]> wrote:
>
> I have some troubles with my project. Here it is the problem:
>
> I have an HTML like this
>
> <a href="">click</a>
> <div> xxxx </div>
>
> <a href="">click</a>
> <div> xxxx </div>
>
> ....
>
> When I click on the link i want to change its class and toggle the
> <div> below without using any ID.
> I have no problem changing the link, but I can't find a way to select
> the FIRST next element.
>
>       $("a").click(function () {
>         $(this).attr({className: "new-class"});
>         $(this + " + div").eq(0).toggle();
>       }
>
> I though something like this would work, but it doesnt.
> How can i select the first next element after my click element?
>
> daniele
>
>
>
>
>
>


-- 
/********************************************
* Người ta thưởng chỉ chú ý đến những kẻ lên như diều gặp gió! Nhưng
hỡi ôi, chỉ có cát, bụi và lông hồng mới là những thứ lên nhanh nhất
*/

Reply via email to