Created
April 12, 2019 09:28
-
-
Save temberature/54a6c874b6ac86cf200cb3b36fd96959 to your computer and use it in GitHub Desktop.
replace <b>text</b> with text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelectorAll('b').forEach(element=>{ | |
// element.parentNode.replaceChild(document.createTextNode(element.innerText), element) | |
console.log(element) | |
if (element.parentNode && element.parentNode.innerText) { | |
element.parentNode.innerHTML = element.parentNode.innerText | |
} | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
document.querySelectorAll('b').forEach(element=>{
// element.parentNode.replaceChild(document.createTextNode(element.innerText), element)
console.log(element)
if (element) {
element.replaceWith(element.parentNode.innerText)
}
}
)