AppendChild with same properties ?

Here is the example: https://vmars.us/Guitar/DragDropElements-CreateNew-NOTE.html
I didn’t get a Reply on my last Post , so I have chunked it way down .
I want to duplicate div id=“myNote” and apply all the same properties .
Pls , how can I do that ?
Thanks

<!DOCTYPE html>
<html>

<style>
.circle {
        border-radius: 50%;
        width: 40px;
        height: 40px;
        background: #CECECE;
        background-color: #DBDBDB; 
		border-width: 40px;  
		border-height: 40px;  
		text-align: center;
        font: 28px Arial black , sans-serif;
</style>

<body>

<h1>The Document Object</h1>
<h2>The createElement() Method</h2>
<p>Create a div element and append it to "myNote":</p>

border-radius: 50%; 
<div id="container">
<div id="myNote"  onclick="createNewNote()" class="circle"; 
style=" background-color: #DBDBDB; border-width: 40px;  border-height: 40px; " >
<p>2</p>
</div>
</div>
<script>
function createNewNote(){
// Create element:
const para = document.createElement("div");
para.innerHTML = "2";
//para.innerHTML = "<div class="item two">2</div>"; 

// Append to another element:
document.getElementById("myNote").appendChild(para);
}
</script>

</body>
</html>

I found this awesome video:
https://www.youtube.com/watch?v=zjYgz50E0mA
cloneNode is new to me .

1 Like

You beat me to it :slight_smile:

Yes, cloneNode ftw! :slight_smile: