Widget:RemoveParserOutputParentDiv
<script> function unwrapElementsByClass(className, parentId) { const container = document.getElementById(parentId); if (!container) return;
const elements = container.getElementsByClassName(className);
// Convert to array since we'll be modifying the live HTMLCollection Array.from(elements).forEach(element => { // Move all children before the wrapper while (element.firstChild) { element.parentNode.insertBefore(element.firstChild, element); } // Remove the empty wrapper element.parentNode.removeChild(element); }); }
unwrapElementsByClass('wrapper-to-remove', 'parent-container-id');
</script>