views:

59

answers:

1

Is there a way that content can be pulled from an XML file into a DIV on click, without using IDs, and with multiple DIVs involved?

For example, in the code below, clicking the first link would make content from an XML file appear only in the DIV below the link, and without manually assigning any IDs to the link or to the DIV.

<a class="reveal">Reveal</a>
<div class="xml-content">Content appears here</div>
<a class="reveal">Reveal</a>
<div class="xml-content">Content appears here</div>

I've been unable to achieve anything like this.

+2  A: 

You could easily do this with JQuery by using it's many selectors. See this page for a list of them, and see specifically the prev - next and first last.

Mladen Mihajlovic