Question

i have a login page and i want a user to not go further if Javascript is disabled. I tried to use noscript tag but the page UserId, Password fields and Login button does appears with the noscript message...How to completely blur the background with an alert and continue only after the user enables the Javascript...

Thanks for your help.

Was it helpful?

Solution

Hide elements with CSS (display: none). Show them with JS. You can make it a class and give that class to all the elements you want hidden.

Use JS to remove that class from those elements to show them. See this answer for how.

Now you won't see the login form unless you have JS. You won't be able to show a JS style alert (that'd require JS, wouldn't it...), but you can hide everything and show a message on the page.

OTHER TIPS

You can show a page-sized div which lies above all other content with an opaque (or semi-transparent) background in a <noscript> block, so that the login form appears below the div.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top