DEV Community

Cover image for Enable a better experience with noscript HTML element!
Jordan Finneran
Jordan Finneran

Posted on • Edited on • Originally published at jordanfinners.dev

Enable a better experience with noscript HTML element!

Contents

  1. Intro
  2. noscript
  3. Example
  4. Summary

Intro

If you run your website with Scripting turned off (JavaScript disabled for example), what do you get? I'd be really interested to see screenshots in comments.

If your site relies upon JavaScript you might not get anything. Now there is a really nice element to provide a better experience to your users if this is the case - introducing noscript

noscript

You can provide those users without scripting a better experience and include custom messaging for them using the noscript element.
This will only be displayed when a script type is unsupported on the page or scripting is turned off.

Example

Shut up and show me the code.

<noscript>
    <p>JavaScript is required to run this page, please enable it by doing X, Y, Z.</p>
</noscript>
Enter fullscreen mode Exit fullscreen mode

Summary

In summary, you can use what browsers give you to create a better experience for those users without scripting!
Even if it is to tell them what to do, to get the real experience.

Element reference can be found here.

Happy building!

Let me know what your sites look like without scripting on!

Top comments (0)