Does anyone know how to remove only the last <BR>
tag within a div using jQuery? The code I tried ends up removing all <BR>
tags in the div instead of just the last one.
HTML Code
<div class="topic">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor.<br/>
Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes,<br/>
nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim. DonecLorem ipsum dolor sit amet, consectetuer adipiscing elit.<br/>
<br/>
<br/>
<br/>
</div>
jQuery Code
$(document).ready(function(){
$('.topic').find('br:last').remove();
});