To turn on JavaScript, open your browser's site settings and set JavaScript to allowed: in Chrome that is Settings > Privacy and security > Site settings > JavaScript, then Sites can use JavaScript. Edge, Safari and Firefox each keep the switch in a different place, covered below, and you must reload the page afterwards.
JavaScript is on by default in current browsers. If a website tells you to turn it on, the setting was changed, a per-site block exists, or something such as an extension or an administrator policy is overriding it. Work through your browser's section and then the troubleshooting list at the end.
How to turn on JavaScript in Google Chrome
On a computer:
- Click the menu (the three dots at the top right), then Settings.
- Click Privacy and security, then Site settings.
- Under Content, click JavaScript.
- In the Default behavior section, select Sites can use JavaScript.
- Close the settings tab and reload the page you were trying to use.
The same page also offers Don't allow sites to use JavaScript. If that is selected, you can keep it and instead add only the sites you trust to the allowed list, which is a narrower fix than allowing everything.
On Android, Google's instructions are: open Chrome, tap More, then Settings. Under Advanced, tap Site settings, then JavaScript, and turn it on. Google's help page also states that JavaScript is on by default on iPhone and iPad.
Menu names change between versions. Typing chrome://settings/content/javascript into the address bar is a shortcut to the same page, though Google's documentation describes the menu route rather than this address.
How to turn on JavaScript in Microsoft Edge
Microsoft's steps for Edge on Windows 11:
- On the More menu (the three dots), select Settings.
- Select Privacy, search, and services, then Site permissions, then All permissions.
- Select JavaScript and check that Allowed (recommended) is turned on.
Reload the page afterwards. If the toggle is on but one site still fails, open the same JavaScript screen and look for that site in the block list.
How to turn on JavaScript in Safari on a Mac
Apple's steps:
- Open Safari and choose Safari > Settings from the menu bar.
- Click the Security tab.
- Select the Enable JavaScript checkbox.
- Close the window and refresh the page.
Apple notes that some websites do not work properly when JavaScript is turned off. I did not find Apple's steps for Safari on iPhone and iPad in the sources checked for this article, so they are not covered here.
How to turn on JavaScript in Firefox
Firefox has no JavaScript switch in its normal Settings page. According to Mozilla's support article, JavaScript is enabled by default, and the control is a preference named javascript.enabled in the Configuration Editor:
- Type
about:configin the address bar and press Enter. Accept the warning that appears. - Search for
javascript.enabled. - If the value is
false, use the Toggle or Reset button to set it back totrue. - Reload the page.
Mozilla warns that changing settings in about:config can affect stability, security and performance, so change only this one preference. If it already reads true, JavaScript is on and the cause is somewhere else, such as an add-on or content blocker.
Quick reference
| Browser | Where the setting is | Value to choose |
|---|---|---|
| Chrome (computer) | Settings > Privacy and security > Site settings > JavaScript | Sites can use JavaScript |
| Chrome (Android) | Settings > Advanced > Site settings > JavaScript | On |
| Edge | Settings > Privacy, search, and services > Site permissions > All permissions > JavaScript | Allowed (recommended) |
| Safari (Mac) | Safari > Settings > Security | Enable JavaScript ticked |
| Firefox | about:config, preference javascript.enabled | true |
How to check that JavaScript is working
Save the following as a file named js-test.html and open it in your browser. It is a short test page, not output from any tool:
<p id="status">JavaScript is OFF</p>
<script>
document.getElementById("status").textContent = "JavaScript is ON";
</script>
The page shows JavaScript is ON when scripts run and JavaScript is OFF when they do not. Some browser configurations restrict scripts on local files, so if it reads OFF while real sites work, that is not conclusive. Try serving it from a real address or test on a site that needs JavaScript.
Why websites show a "turn on JavaScript" message
That message is usually written inside a <noscript> element. MDN defines it as a section of HTML that is inserted if a script type on the page is unsupported or if scripting is currently turned off in the browser. With scripting enabled, the contents are not displayed, so seeing the message means the page believes scripts are not running. That can be true for the whole browser or only for that site.
<noscript>
Please turn on JavaScript to use this page.
</noscript>
If JavaScript is on but the page still says it is off
- Reload, then hard reload. The setting applies to pages loaded after you changed it. Press Ctrl+Shift+R (Cmd+Shift+R on a Mac) to bypass cached content.
- Check the per-site list. Chrome and Edge keep a list of sites that are blocked from using JavaScript even when the default is allowed. Remove the site from it.
- Disable script blockers. Ad blockers and privacy extensions can block scripts without touching the browser setting. Mozilla's support page lists content-blocking tools among the things to check. Turn the extension off for that site and reload.
- Look for a managed browser. On a work or school device an administrator can control the setting. Microsoft documents an Edge policy,
DefaultJavaScriptSetting, that either allows JavaScript for all sites or blocks it for all sites. If it is not configured, all sites can run JavaScript by default and the user can change the setting. If it is configured, the choice is not yours, so ask your IT department. - Try another browser or a private window. If the page works there, the cause is a setting or extension in your normal profile, not the site.
For administrators: setting it by policy on Edge
Microsoft lists two values for DefaultJavaScriptSetting: 1 (AllowJavaScript) allows all sites to run JavaScript, and 2 (BlockJavaScript) does not allow any site to run it. On Windows the policy lives in the registry at SOFTWARE\Policies\Microsoft\Edge as a REG_DWORD named DefaultJavaScriptSetting, and in Group Policy under Administrative Templates/Microsoft Edge/Content settings. Setting it to 1 forces JavaScript on for every site.
Frequently asked questions
- Is JavaScript on by default in my browser?
- Yes in all the major browsers. Microsoft's Edge documentation says that when the policy is not configured, all sites can run JavaScript by default, and Mozilla's support article says Firefox enables it by default. If a page says JavaScript is off, something changed the setting, or an extension, content blocker or administrator policy is blocking it.
- Is it safe to leave JavaScript turned on?
- It is the normal state of the web and almost every modern site depends on it. If you want to limit it, Chrome and Edge let you block JavaScript by default and allow it only for sites you choose, which is safer than turning it off everywhere.
- Why does a site still say JavaScript is disabled after I turned it on?
- Reload the page first, because the setting applies to pages loaded afterwards. If the message stays, check for an extension or ad blocker that blocks scripts, a per-site block in the browser's JavaScript settings, or a policy set by your organisation.
- Why is the JavaScript setting greyed out or missing?
- On a work or school computer an administrator can control it. Edge has a policy called DefaultJavaScriptSetting that either allows or blocks JavaScript for every site, and when it is set by an administrator you cannot change the setting yourself. Ask your IT department.
Sources
- Microsoft Support — Enable JavaScript
- Google Help — How to enable JavaScript in your browser
- Apple Support — Turn JavaScript on or off in Safari on Mac
- Microsoft Learn — Edge policy DefaultJavaScriptSetting
- MDN — The noscript element
- Mozilla Support — JavaScript settings and preferences for interactive web pages