how to remove the content of a html element

Solutions on MaxInterview for how to remove the content of a html element by the best coders in the world

showing results for - "how to remove the content of a html element"
Adelia
01 Jan 2021
1const elementParent = document.getElementById('parentEl');
2const elementToRemove = document.getElementById('childEl');
3elementParent.removeChild(elementToRemove);