Hi guys,
I have a datalist being generated with ASP, but unfortunately the jQuery script that I'm using to scroll through the results requires the layout to be as so:
<div class="itemContainer">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
ASP generates something that looks like this:
<div class="itemContainer">
<div class="item"><span></span><br /></div>
<span></span>
<br />
<div class="item"><span></span><br /></div>
<span></span>
<br />
<div class="item"><span></span><br /></div>
<span></span>
<br />
</div>
The problem is that the divs also contain span and br elements, so simply looking for those elements and using the .remove() method doesn't work. I need to delete all the span and br elements, but only the ones that are direct ancestors of the 'itemContainer' div. I hope that is clear, any help would be much appreciated. Alternatively if there is a way to get ASP to generate a datalist with only divs, that would also be helpful. Thanks!