replaceWith bug?
replaceWith bug?
Hi, replaceWith does not seem to work anymore with text nodes in jQuery 1.9
- textnode.replaceWith('some content');
does nothing; I can see the text node content with
- alert(textnode.text());
Sample code:
- <div id="nodes">
text node
<a href="#" title="Some link">some link</a>
other text
</div>
- $('#nodes').contents().each(function(){
alert($(this).text());
$(this).replaceWith('replaced!');
});
see jsfiddle
Any ideea?