4 ms·
What are the benefits of this compared to showing hidden divs, which can be done in one line of code with a CSS selector?
by loginx 17y ago
What are the benefits of this compared to showing hidden divs, which can be done in one line of code with a CSS selector?
- halo 17y agoThe argument is progressive enhancement: if someone doesn't have JavaScript or CSS enabled the JavaScript-enabled features would be completely hidden from view, plus you get to keep your HTML in your HTML file.
- loginx 17y agoOkay I get the point for missing CSS, that makes sense... But in the case of only JS being disabled, a hidden div will remain hidden also, thus accomplishing the exact same thing in that case.
- mustpax 17y agoI can see how someone might turn your external style sheets off, but an inline style="display:none" attribute is not going to be ignored by any browsers. What's so inaccessible about that?