Build anchor list from div contents
Search a list of divs and build a list of links and corresponding anchors for each, appending the links to one div and the anchors to the originating div.
HTML
<ul id="businessListingLinks">
<!--<li><a href="#abcChildcare">ABC ChildCare and Learning Center</a>
</li>
<li><a href="#affordableExcavating">Affordable Excavating</a>
</li>
<li><a href="#andesTower">Andes Tower Hills</a>
</li>-->
</ul>
<br>
<br>
<div id="businessListings" class="unifyRepeatArea">
<div class="unifyRepeat listing">
<p>123 ABC Child Care</p>
<p>Jane Doe, Owner</p>
<p>555-555-1234</p>
<img src="images/123ABCchildcare.jpg" width="50" height="50">
</div>
<div class="unifyRepeat listing">
<p>International Widgets, Inc.</p>
<p>Specializes in custom widgets</p>
<p>John Smith, President</p>
<p>555-555-4321</p>
<img src="images/intlWidgets.jpg" width="50" height="50">
</div>
<div class="unifyRepeat listing">
<p><a href="http://www.example.com">Awsome Ski Resorts</a></p>
<p>Winter fun... For everyone!</p>
<p>555=555-9876</p>
<p>
<img src="images/skiHill1.jpg" width="50" height="50">
<img src="images/skiHill3.jpg" alt="" width="50" height="50">
</p>
</div>
</div>
<!-- End #listings -->
JavaScript
$('#businessListings div.listing').each(function() {
alert('text: ' + $(this).find('p').text());
});