I have the following array...
var structure = [
[icon, "Section 1 Name",
[icon, "Item 1.1"],
[icon, "Item 1.2"]
],
[icon, "Section 2 Name",
[icon, "Item 2.1"],
[icon, "Item 2.2"]
],
[icon, "Section 3 Name",
[icon, "Item 3.1"],
[icon, "Item 3.2"]
]
];
And I would like to loop through it to populate my HTML structure in the following method...
<div id="section">
<h1>Section 1 Name</h1>
<a href="#">Menu Item 1.1</a><br />
<a href="#">Menu Item 1.2</a>
<h1>Section 2 Name</h1>
<a href="#">Menu Item 2.1</a><br />
<a href="#">Menu Item 2.2</a>
<h1>Section 3 Name</h1>
<a href="#">Menu Item 3.1</a><br />
<a href="#">Menu Item 3.2</a>
</div>
I have been trying to find advice online about how to achieve this but most of the advice I have been able to find is more suited to multi-dimensional arrays which are used to show a data grid type of layout rather than heading and sub item structures.
Thanks
iconhere?