Quiero cambiar el color de un área específica al hacer clic en un botón. Pero cambie todo el fondo en lugar de solo el índice h2 0.
btn = document.createElement("button"); btn.innerHTML = "L1"; btn.onclick = (changeColor) => { changeTags = document.getElementsByTagName("h2"); c = changeTags[0]; console.log(c); alert("This button is designated to Level 1 CM Approver Teams"); document.body.style.backgroundColor = "red"; }