I have the following markup and want to place 'here is my info' after this when an ajax callback is triggered. My markup:
<div data-item-header-id="17">
here is an item
</div>
<div data-item-header-id="17">
here is another item
</div>
<!-- put 'here is my info here' here -->
<div data-item-header-id="18">
here is another item
</div>
The alert is called but isn't being put in the right place. How would I select given the above markup?
if(r.is_placed_at_end=='true'){
alert('will place at end');
$('data(item-header-id==17):last)').after("here is my info");
}
I tried looking at this but didn't get me all the way there. jquery data selector
Also, is this proper usage of data elements?
thx