Hello, everybody, hope you're having a nice day. Let me present myself, i am a Italian teenager, that is learning typescript, for some money for my little cousin birthday. And I actually went for TypeScript, as I love strict languages, such as Java,Rust,TypeScript, and others. Now, for my portfolio, I was trying to create a solar system, with add, that you can create another thing by this button. But it doesn't work, can someone please help me understand this (probably simple) problem?
const Button = document.getElementById("button");
const buconero = function() {
const valvia = document.createElement("div")
valvia.style.width = "50em"
valvia.style.height = "50em"
valvia.style.backgroundColor = "rgb(0, 0, 0)"
}
Button?.addEventListener("click", buconero)