Evento en JS no.1

HTML
<div id="root"></div>
CSS
body{ background-color:#EDEFEE; } body h1{ background-color:#B40404; color:#E6E6E6; text-align:center; margin:0px; margin-top: 0px; }
JAVASCRIPT
const root = document.getElementById("root"); root.innerHTML ="<h1>Programando en Javascript</h1>"; root.addEventListener("click",()=>{ root.innerHTML += "<br/><label>Has dado click en la etiqueta div 'root'</label>"; });
Expand for more options Login