moveBefore()Limited availability
The moveBefore() DOM method relocates a node while preserving its state. For example, you can move the active element without losing focus, move an animated element without resetting the animation, or move an iframe without reloading its content.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–132Not supported
133+Supportedsince Feb 4, 2025
Current: 155Edge
12–132Not supported
133+Supportedsince Feb 6, 2025
Current: 154Firefox
1–143Not supported
144+Supportedsince Oct 14, 2025
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–132Not supported
133+Supportedsince Feb 4, 2025
Current: 155Firefox Android
4–143Not supported
144+Supportedsince Oct 14, 2025
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Safari, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: moveBefore.
Feature detection
JS · check before using
if ("Document" in globalThis && "moveBefore" in Document.prototype) {
// Document.moveBefore is available
}Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| CustomElementRegistry.define.connectedMoveCallback_lifecycle_callback | 133 | 133 | 144 | ✕ | 133 | 144 | ✕ |
| Document.moveBefore | 133 | 133 | 144 | ✕ | 133 | 144 | ✕ |
| DocumentFragment.moveBefore | 133 | 133 | 144 | ✕ | 133 | 144 | ✕ |
| Element.moveBefore | 133 | 133 | 144 | ✕ | 133 | 144 | ✕ |