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

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....



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

Search: