DEV Community

Discussion on: How to replace arbitrary portions of HTML?

Collapse
 
irreverentmike profile image
Mike Bifulco

I've read this a few times, and I'm not entirely sure what you're asking for, Ben. Can you clarify a bit? It looks like there's some malformed HTML in the first snippet, and incomplete HTML in the second.

Collapse
 
ben profile image
Ben Halpern

Basically I want to replace the first half of the document, without concern for HTML elements or depth etc. Basically split the string in half and replace the first half with new HTML.

Collapse
 
pavelloz profile image
Paweł Kowalski

For some reason seems like a bad idea :)