Hacker News new | ask | show | jobs
by ricardobeat 5023 days ago
Not really, if you add style="display:none" inline, or use the `hidden` attribute, it will be correctly ignored by all screen readers.

<script type="whatever"> is mostly used because it's completely ignored. It's safely hidden, difficult to be accidentally messed with, and doesn't take parsing/rendering time from the browser.

1 comments

Right but, as mentioned, inline styling is mixing markup and styles so it's best avoided (plus you're still relying on CSS to hide the content).

Regarding the `hidden` attribute, there is no support for it in IE (at least up to and including 9).

I know a lot of people argue against mixing markup and styling. As one of those, and since you seem well informed, how do you feel about the various css frameworks like bootstrap where the class names are essentially style descriptions?