SoFunction
Updated on 2025-04-07

Introduction to the use of javascript copy node cloneNode


<div >
<span>1</span>
<span>2</span>
<span>3</span>
</div>
var oDiv = ("guoDiv");
var deepList = (true); //Copy child nodes
alert(); //3 or 7 (compatibility issues, so the results are different)
var showList = (false); // Only copy the reference of the current element
alert(); //0