# AppendChild with same properties ?

**URL:** https://forum.kirupa.com/t/appendchild-with-same-properties/654358
**Category:** programming
**Created:** [November 1, 2022, 5:01pm UTC](https://forum.kirupa.com/t/appendchild-with-same-properties/654358 "2022-11-01T17:01:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)
#### Post date: [November 1, 2022, 5:01pm UTC](https://forum.kirupa.com/t/appendchild-with-same-properties/654358/1 "2022-11-01T17:01:30Z")

</div>

Here is the example: [https://vmars.us/Guitar/DragDropElements-CreateNew-NOTE.html](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>

```

---

<div class="post-metadata">

### Author: ![vmars316](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vmars316](https://forum.kirupa.com/u/vmars316)
#### Post date: [November 1, 2022, 5:59pm UTC](https://forum.kirupa.com/t/appendchild-with-same-properties/654358/2 "2022-11-01T17:59:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [November 1, 2022, 8:22pm UTC](https://forum.kirupa.com/t/appendchild-with-same-properties/654358/3 "2022-11-01T20:22:25Z")

</div>

You beat me to it 🙂

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [November 1, 2022, 8:24pm UTC](https://forum.kirupa.com/t/appendchild-with-same-properties/654358/4 "2022-11-01T20:24:52Z")

</div>

Yes, `cloneNode` ftw! 🙂
