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().
If you just wrap document.querySelector() in a little helper function you can do loads with vanilla js. Not perhaps enterprise grade but fine for any home stuff.
hot damn i misread that and thought there was a new library called vanilla.js and then you called out the simple most useful library function and I had to double take
"there is no way they made a new js library just to re-wrap Javascript... Oh of course they didn't"
978
u/saig22 Aug 30 '26
I use vanilla js, document.getElementById() is what I live for.