Selecting a div with same ID as the rel attribute of clicked link
- by Chris
Hi there,
This is a two-part question. I'm using jQuery for a project and wanting to click a link and toggle the class name "highlight" to that link and also to the div with the same id as the rel attribute of the link. I then want to be able to link to the next div without the classname of "highlight". Here's the HTML for it:
<ul>
<li><a href="#" rel="panel1">Item 1</a></li>
<li><a href="#" rel="panel2">Item 2</a></li>
<li><a href="#" rel="panel3">Item 3</a></li>
</ul>
<a href="">go to next div without class of highlight</a>
<div id="panel1">some text</div>
<div id="panel2">some text</div>
<div id="panel3">some text</div>
Can anyone help with jQuery side of things?
Many thanks in advance!