> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: removeElement(selector: string) # Method package: wixEditor # Method menu location: wixEditor --> removeElement # Method Link: https://dev.wix.com/docs/velo/velo-only-apis/wix-editor/remove-element.md # Method Description: Removes a widget element from the stage. The `removeElement()` function returns a Promise that is resolved when the element is removed. You can only remove elements that are part of the widget with which the panel is associated. The element selector is a string with the hash symbol (`#`) followed by the ID of the item you want to select (for example, `"#myElement"`). To use this function on an inner (nested) widget, use [`getScopedWixEditor()`](#getScopedWixEditor). # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Use a toggle switch to remove/restore a widget element ```javascript // In this example, we use a toggle switch to remove or restore an element in our widget. import wixEditor from 'wix-editor'; $w.onReady(async function () { $w('#toggleSwitch').onClick(async (event) => { if (event.target.value) { await wixEditor.removeElement('#title'); } else { await wixEditor.restoreElement('#title'); } }); }); ``` ---