Why do we use ev.target.appendChild(document getElementbyId(data)); | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Why do we use ev.target.appendChild(document getElementbyId(data));

20th Jun 2019, 2:59 PM
afsha tamboli
afsha tamboli - avatar
2 Respuestas
+ 1
Where did you see this statement? after getElementById(data), there should be .innerText
20th Jun 2019, 3:50 PM
Gordon
Gordon - avatar
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.
20th Jun 2019, 4:47 PM
YoBoi