[jQuery] Re: Add class on click, then remove when click another, and add to that.

2008-06-27 Thread hubbs
Thank you! This will work perfectly. Yes, I need the link to be followed, because it loads content into a div using ajax, so, removing return false; will be what i need. Any thank you for commenting the code! That really helps for beginners! On Jun 26, 1:15 am, sheshnjak [EMAIL PROTECTED]

[jQuery] Re: Add class on click, then remove when click another, and add to that.

2008-06-26 Thread andrea varnier
On 26 Giu, 07:47, hubbs [EMAIL PROTECTED] wrote: I have a list of links, and when one is clicked, I would like a class to be added.  I understand how to do this, but when you click another link, I would like the class removed from the first click and added to the second click, and so on, so

[jQuery] Re: Add class on click, then remove when click another, and add to that.

2008-06-26 Thread ..:: sheshnjak ::..
You probably have something like this in HTML: div class=targetLinkList a href=1bla 1/abr / a href=2bla 1/abr / a href=3bla 1/abr / /div Put this in css, just for testing (to see if class is set properly): a.clicked {background-color:red} Finally, in write this in your jQuery js:

[jQuery] Re: Add class on click, then remove when click another, and add to that.

2008-06-26 Thread sheshnjak
Hi, I think this should work for you: - Basically, you have this in html: div class=targetLinkList a href=1bla1/abr / a href=2bla2/abr / a href=3bla3/abr / /div - To see the results put this in your css: a.clicked {background-color: red} - And finally, you should put this in js file: