하위 노드 appendChild 추가()

7051 단어
DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>     appendChild()title>
    
head>
<body>
    <div>
        <p>   div   p>
        <a href="#">   div   a>
    div>
    <script>
        var span=document.createElement("span");//  span    
        span.innerHTML="

"+" ";// span var text=document.createTextNode(" div ");// var div=document.getElementsByTagName("div")[0];// div span.appendChild(text);// span text div.appendChild(span);// div span script> body> html>

좋은 웹페이지 즐겨찾기