"AppendChild" same element multiple times in js

 https://dev.to/kiumad/can-you-appendchild-same-element-multiple-times-in-js-probably-not-4j

We can use cloneNode() , but I use another way
I want to use a function
like this :

//main function
function appendChildMultiple(parent) {
  //check function argument is an element
  if (parent.nodeType !== undefined) {
    const pTag = document.createElement("p");
    pTag.innerText = "This is the appended element";
    //finally append child to parent
    parent.appendChild(pTag);
  }
}

and use it :

const d1 = document.createElement("div");
const d2 = document.createElement("div");
appendChildMultiple(d1);
appendChildMultiple(d2);

Không có nhận xét nào:

Check to be sure that port 22 is enabled before you reload

 https://superuser.com/questions/590600/ufw-is-active-but-not-enabled-why etting  ENABLED=yes  in  /etc/ufw/ufw.conf  did it for me. $ sudo ...