Remove <b> tag from text
问题 I want to make a bold text non-bold using Greasemonkey. I have only found ways to remove the tag along with its text, but not a way to simply remove the tag itself. So how do I make <b> some text </b> just some text ? 回答1: Assuming you've only one TextNode inside each B tag. b.parentNode.replaceChild(b.firstChild, b); Example : http://jsfiddle.net/DGTh5/ 回答2: Assuming you're dealing with elements, not a string: function unwrapChildren(element) { var parent, node, nextNode; parent = element