How to unwrap a text from a HTML tag using jQUery?
For instance, how to transform this HTML
A sentence with bold
I think relying solely on jQuery in this case needlessly complicates things. It would be easier to use the replace
method which accepts either a normal string or a regular expression.
Using regex is generally the way to go in this case, because you want multiple substitutions which have roughly the same pattern.