Write the code for adding new elements dynamically?
0
firstP function addNode() { var newP = document.createElement("p");var textNode = document.createTextNode(" This is a new text node");newP.appendChild(textNode); document.getElementById("firstP").appendChild(newP); }
Sign in to add a comment
0 Answers
0
📝 No answers yet!
Be the first to answer this interview question.
Your Answer
Sign in to post your answer and help the community.