0
Why this script is not working ? Is there something wrong
<body> <div id="d"> <p id ="p0"> hello </p> </div> <script> var p1 = document.createElement("p"); var hi= document.createTextNode("hi"); p1.appendChild (p1); var pare = document.getElementById("d"); var child = document.getElementById("p0"); pare.replaceChild(p1, p0); </script> </body>
2 Respuestas
0
Plz post code in playground instead of code in description.
0
I think you should write
P1. appendChild(hi) ;