The following is an extended function I wrote. Although it is already available online, it is only used for my own training. . .
function prependChild(o,s){
if (s.hasChildNodes()){
s.insertBefore(o,s.firstChild);
}else{
s.appendChild(o);
}
}
function insertAfert(o,s){
if(s.nextSibling!=null){
s.parentNode.insertBefore(o,s.nextSibling);
}else{
s.parentNode.appendChild (o);
}
}
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn