Cloning an element

Report a typo

You have a product card:

<div>
  <h3>Name</h3>
  <p>Description</p>
  <p>Price</p>
</div>

Your task is to clone the card with all its child elements and assign it to a variable with the name copy. The card variable is created below:

let card = document.querySelector("div");

Use the existing variable and a single line of code.

Enter a short text
___

Create a free account to access the full topic