Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use CSS to hide the unstyled content, and then JavaScript to remove that styling and display it. This will, of course, invoke the ire of those who browse with JavaScript disabled.


How I did it is begin with .no-js class and using Modernizr to remove the class so I can style element for .no-js .my-class -> visibility: visible and .my-class -> visibility: hidden then finally using JS to remove visibility css.

So if .no-js class is available (when browser disabled JS), .my-class element still visible.

If .no-js is not available (when browser enabled JS), .my-class element will be hidden and visible by your JS

See http://stackoverflow.com/questions/6724515/what-is-the-purpo....




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: