Jump to content

How to find single <hr> or <br> elements and remove them with Javascript?


pstein

Recommended Posts

Assume I have HTML code similar to

<div ...>....</div><hr><div ...>....</div>
or
<p>....</p><br><p>....</p>

As you can see there are single <hr> or <br> elements with some leading or trailing whitespaces but no further textaround them.How can I delete them (including the leading/trailing whitespaces) but not the <div> resp. <p> elements before and after?Peter

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...