jquery-replacetext
jquery-replacetext copied to clipboard
Handle adjacent text nodes?
Ideally, adjacent text nodes should be "collapsed" into a single text node. For example:
$('<div>foo<span>bar</span>baz</div>')
.find('span')
.remove()
.end()
.contents()
.get(); // [ "foo", "baz" ]