I'm looking for some ideas for the most efficient way to remove trailing html <br/> tags using javascript or jquery.
RULES:
- The br, at the front and end must be removed.
- It must remove non-closing and self-closing br tags.
- All br within the textual content must remain untouched.
THE HTML:
<div class="generatedContent">
<br>My awesome content.
<br><br>Some More awesome content.
<br>
<br>
<br>I still need the content written here<br/>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
THE DESIRED OUTPUT:
<div class="generatedContent">
My awesome content.
<br><br>Some More awesome content.
<br>
<br>
<br>I still need the content written here
</div>