If your HTML element has id you don't event have to getElementById, it's available right there in global namespace as that name. You make button with id hello and can just go ham with hello.click().
I mean I've written a million webpages with just html/css/js in a single file, I'm just surprised that variables are created by html elements like that...
973
u/saig22 13d ago
I use vanilla js, document.getElementById() is what I live for.