I am trying to organize a list of links and names based on a tag that is outside of the group of where the links and name reside. It's setup like so:
<h4>Volkswagen</h4>
<ul>
<li><a href="http://beetle.cars.com">beetle</a></li>
</ul>
<h4>Chevy</h4>
<ul>
<li><a href="http://volt.cars.com">Volt / Electric</a></li>
</ul>
What I need is the result to be in the following format with the name as a link eventually but I can do that later if I can just get the items organized properly.
Each car brand could have multiple models of varying counts. I would need to organize them by car brand:
Volkswagen
Beetle Link Beetle
Jetta Link Jetta
Chevy
Volt Link Volt / Electric
S10 Link S10
I can get the list of brands with no problem. I am just having a hard time associating the batch of models with each brand as the <h4>
tags aren't nested so I don't know how to associate them with the following <ul>
list of cars.