I am a self-taught Frontend Developer. I like building functional and beautiful websites. Now I'm keen on Javascript and React. Also I write about useful hacks and web development.
Some devs prefered write this way, some people use checked property. There is always a place to play with code. Everybody chooses what they prefer. Piece!
Again, not JavaScript's job if you can avoid it, since you're alienating large swaths of users. Much less onEvent attributes being relics of two decades ago that should have been axed at that time...
... and using some rubbish framework or pre-processor to do "templates" with it doesn't fix that. If anything, it simply proves that people are throwing JavaScript client-side in ways that are NONE of JavaScript's flipping business.
See 90%+ of what people do with mentally enfeebled trash like React or jQuery... the stuff I have to rip out in my day job of sites in court for WCAG violations!
I am a self-taught Frontend Developer. I like building functional and beautiful websites. Now I'm keen on Javascript and React. Also I write about useful hacks and web development.
Sheesh... talk about convoluted and a NASTY case of "JS for nothing"
Set the DIV up to behave as a body replacement (I often have this in place anyways as a fix for the "double scroll bar" modal issue)...
Then just "#toggle_dayNight:checked + .dayNight {}" to set the override colours.
Not a single line of scripting needed. "hidden" is your new best friend.
JS for nothin' and your scripts for free. That ain't workin', that's not how you do it...
Some devs prefered write this way, some people use
checked
property. There is always a place to play with code. Everybody chooses what they prefer. Piece!Example code:
Again, not JavaScript's job if you can avoid it, since you're alienating large swaths of users. Much less onEvent attributes being relics of two decades ago that should have been axed at that time...
... and using some rubbish framework or pre-processor to do "templates" with it doesn't fix that. If anything, it simply proves that people are throwing JavaScript client-side in ways that are NONE of JavaScript's flipping business.
See 90%+ of what people do with mentally enfeebled trash like React or jQuery... the stuff I have to rip out in my day job of sites in court for WCAG violations!
So much pain is in the comment above 😀
Thanks for WCAG reference