Back to Browse

How to Clone HTML Elements — JavaScript DOM Tutorial

15.4K views
Jan 30, 2018
4:25

Using the Node.cloneNode() method in Javascript, you able to make a copy of a Node (most commonly an element). It allows for a deep copy and also a shallow copy. In this video we explore the use of the cloneNode method with an un-ordered list, and discover the effects of using a shallow copy as opposed to a deep copy. For your reference: https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

Download

1 formats

Video Formats

360pmp45.3 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How to Clone HTML Elements — JavaScript DOM Tutorial | NatokHD