0
Why do we use ev.target.appendChild(document getElementbyId(data));
2 Answers
+ 1
Where did you see this statement?
after getElementById(data), there should be .innerText
0
//The method appendChild places a newly created element created with document.createElement inside of a parent. Use:
var x = document.createElement(âdivâ);
x.setAttribute(âidâ,âabcâ);
x.classList.add(âaDivâ);
document.body.appendChild(x);
//This places the created div element inside of the body (I also gave it an id of abc and added the class aDiv).
//Edit: ev is probably an object and target is a selector for an argument.