MCPcopy Create free account
hub / github.com/WhiteSevs/TamperMonkeyScript / replaceWith

Method replaceWith

lib/DOMUtils/src/index.ts:1377–1402  ·  view source on GitHub ↗

* 将一个元素替换为另一个元素 * @param $el 目标元素 * @param $newEl 新元素 * @example * // 替换元素a.xx为b.xx * DOMUtils.replaceWith(document.querySelector("a.xx"),document.querySelector("b.xx")) * DOMUtils.replaceWith("a.xx",' ')

($el: DOMUtilsTargetElementType, $newEl: HTMLElement | string | Node)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls 6

removeMethod · 0.95
isNodeListMethod · 0.80
forEachMethod · 0.80
selectorAllMethod · 0.45
toElementMethod · 0.45
afterMethod · 0.45

Tested by

no test coverage detected