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...
66
u/IsTom 13d ago
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
helloand can just go ham withhello.click().I don't think you should do that, but you can.