duplicate element in js

Table of Contents

const dupElement = elelment.cloneNode()
const dupElement = elelment.cloneNode(true) // deep clone; clone the elelment with its subtree

Backlinks

Author: Linfeng He

Created: 2024-04-03 Wed 20:20