To enable JavaScript on an iPhone, open Settings, tap Apps, tap Safari, scroll to the bottom and tap Advanced, then turn on JavaScript. On iOS 17 and earlier there is no Apps list, so the path is Settings > Safari > Advanced. Reload the page afterward and the site should work.
Applies to: Safari on iPhone and iPad with iOS and iPadOS 18, 26 and 27 (the current version), plus older versions with the shorter path. The switch is the one Apple lists in its help page for when Safari isn’t loading websites.
JavaScript is on by default. If the switch is already green and a site still shows “Please enable JavaScript” or has dead buttons, the cause is usually a content blocker, Lockdown Mode, Screen Time, old website data, or the browser you’re using. Those fixes are below.
What JavaScript is and where the setting lives
JavaScript is the code websites use to do things after the page loads: open menus, play videos, show maps, check what you typed into a form, and run shopping carts and sign-in pages. Without it, many sites show plain text, a blank page or a warning.
A few points that save confusion:
- You don’t install it. JavaScript is built into Safari and every other iPhone browser. There’s nothing to download from the App Store.
- The switch belongs to Safari. It’s in the Settings app, not inside Safari itself, and it only changes Safari. Chrome, Firefox, Edge and other browsers aren’t affected by it.
- It’s all or nothing. Safari on iPhone has no per-site JavaScript setting. When the switch is on, every site can run scripts.
- It isn’t Java. Java is a different technology with a similar name. iPhones don’t run Java in the browser at all.
Turn on JavaScript in Safari
These steps are the same on an iPhone and an iPad.
- Open the Settings app (the gray gear icon on your Home Screen). If you can’t find it, swipe down on the Home Screen and search for “Settings.”
- Scroll down and tap Apps. You’ll see an alphabetical list of your apps.
- Tap Safari. Typing “Safari” into the search field at the top of the Apps list gets you there faster.

- Scroll to the very bottom of Safari’s settings and tap Advanced.
- Find JavaScript and tap the switch so it turns green. The change is saved right away; there’s no Save button.

- Go back to Safari and reload the page by tapping the reload arrow in the address bar. If the page still complains, close the tab and open the site in a new tab.
If your iPhone runs iOS 17 or earlier, step 2 doesn’t exist. Scroll down the main Settings screen, tap Safari, and continue from step 4. Apple moved app settings into the Apps list with iOS 18, which is why older guides and screenshots show the shorter path. To check your version, go to Settings > General > About and look at iOS Version.
Turn JavaScript off again
Repeat the steps and tap the switch so it’s gray. Some people do this to cut down on ads or to read a text-heavy page faster, but many sites will stop working properly, including most sign-in, banking and shopping pages. Because the switch applies to every site, remember to turn it back on before you use one of those.
Chrome, Firefox, Edge and other iPhone browsers
Third-party browsers on the iPhone run JavaScript all the time. Google’s help page on allowing JavaScript in your browser notes that JavaScript is turned on by default in Chrome for iPhone and iPad, and Chrome’s iPhone settings don’t include a JavaScript switch. Its site settings cover things like pop-ups instead.
The reason is that Apple’s App Store rules require iPhone browsers to use WebKit, the same engine and JavaScript engine as Safari, except for browsers given special permission in the EU and Japan. So the JavaScript itself works the same way across browsers, but each app keeps its own settings, data and blockers.
If a site works in Safari but not in your other browser, try this in that browser:
- Update it from the App Store.
- Turn off its built-in ad blocking, tracker blocking or “script blocking” option, at least for that site. Privacy-focused browsers often have one of these turned on by default.
- Clear its browsing data (cookies and cached files) from the app’s own settings.
- Close the app completely and open it again.
The opposite case works too. If a site fails in Safari but loads in Chrome, the problem is almost certainly a Safari setting, so work through the next section.
JavaScript is on but the site still doesn’t work
Work through these in order. Test the page after each one so you know which change fixed it.
1. Turn off content blockers for the site
Ad blockers and privacy extensions can stop the scripts a site needs. To test one site, open it in Safari, tap the Page Menu button next to the address bar (its position depends on your tab layout), tap Website Settings, and turn off Use Content Blockers. Then reload. To switch blockers off everywhere, go to Settings > Apps > Safari > Extensions and turn each one off. If the site works, turn the blockers back on one at a time to find the one causing trouble.
2. Check Lockdown Mode
Lockdown Mode is an optional, extreme protection for people who may be targeted by sophisticated attacks. According to Apple’s Lockdown Mode page, it blocks certain complex web technologies, so some sites may load more slowly or not work correctly, web fonts may not appear and images may show as a missing-image icon. It doesn’t switch off the JavaScript setting, but heavy web apps can still break.
See whether it’s on under Settings > Privacy & Security > Lockdown Mode. If you rely on it, don’t switch it off entirely for one website. Instead, exclude only a site you trust: open the site in Safari, tap the Page Menu button, tap Website Settings, and turn off Lockdown Mode for that site. Excluding a site lowers your protection on it, so keep the list short.

3. Clear the site’s website data
A damaged cookie or cached script can make a page fail even with JavaScript on. To clear one site, go to Settings > Apps > Safari > Advanced > Website Data, find the site, swipe left on it and tap Delete. You’ll be signed out of that site.
Clearing everything is the bigger hammer: Settings > Apps > Safari > Clear History and Website Data. It signs you out of every site and removes your browsing history, so you may want to look through your Safari history on iPhone first if you need to find a page again.
4. Allow the pop-up the site is trying to open
Payment, sign-in and print buttons often use JavaScript to open a new window, and Safari blocks it, so the button seems to do nothing. If that’s the symptom, turn off the pop-up blocker on iPhone while you use the site, then turn it back on.
5. Check Screen Time and work restrictions
Screen Time’s web filters can block sites, which can look like a broken page. On a child’s iPhone in iOS 27, a parent finds the web filter under Settings > Family > the child’s name > Apps & Websites > Restrictions (see Apple’s parental controls guide). On your own iPhone, look in Settings > Screen Time. A work or school iPhone may also have settings locked by the organization; if the JavaScript switch is missing or gray, ask whoever manages the device.
6. Try a different connection
Apple’s troubleshooting steps for Safari include loading the site over cellular data or another Wi-Fi network, checking any VPN you use, and temporarily turning off iCloud Private Relay if only one site is affected. A network that blocks part of a site can produce the same “enable JavaScript” message.
7. Update iOS and restart
Safari is updated through iOS updates, and an old version can’t run some newer website code. Go to Settings > General > Software Update, install anything waiting, then restart the iPhone.
8. Ask for the desktop site
Some sites send a different, buggier page to phones. Tap the Page Menu button and choose Request Desktop Website. If that works, the problem is on the site’s side.
How to tell JavaScript is working
- The setting: Settings > Apps > Safari > Advanced shows the JavaScript switch in green.
- A known site: open a site you know relies on scripts, such as a web map or webmail. If its menus and buttons respond, JavaScript is running and the original problem belongs to that one site.
- The message disappears: pages that showed “JavaScript is disabled” or “Please enable JavaScript” load normally after you reload them in a new tab.
To undo the change, turn the switch off on the same screen. Nothing else changes when you turn it on or off: your bookmarks, history and passwords stay as they were.
JavaScript in Safari on a Mac
The iPhone switch doesn’t change your Mac, even if Safari syncs through iCloud. On a Mac, open Safari, choose Safari > Settings, click Security, and select Enable JavaScript. Apple describes the option on its Safari Security settings page. If you can’t see the checkbox, some Safari versions may show it only after you select Show features for web developers in the Advanced tab.
Is it safe to leave JavaScript on?
Yes, for almost everyone. Safari keeps websites walled off from your files and other apps, and iOS updates fix browser security issues regularly, so staying up to date protects you far more than switching JavaScript off. If you’re worried about targeted attacks, Lockdown Mode is the purpose-built option; it limits risky web features while leaving the JavaScript switch alone.
FAQ
Why does a website say JavaScript is disabled when the switch is on?
The page may have been loaded before you changed the setting, or something else is stopping its scripts. Open the site in a new tab first. If the message remains, a content blocker, Lockdown Mode or a privacy option in a third-party browser is the most likely cause.
Can I turn JavaScript on for just one website?
Not in Safari on iPhone. The switch covers every site. What you can do per site is turn off content blockers or exclude the site from Lockdown Mode, both from the Page Menu’s Website Settings.
I don’t see Apps in Settings. Where is Safari?
Your iPhone is on iOS 17 or earlier. Safari is listed directly on the main Settings screen, in the group of Apple apps with Mail, Messages and Phone. Tap it, then Advanced.
Does the Safari setting affect apps that show web pages?
The documented switch is for Safari. Other browsers manage their own behavior, and apps with built-in web pages are controlled by their developers. If a web page inside another app fails, open the same link in Safari to see whether the problem is the site or the app.
Do I need JavaScript on a Windows PC too?
It’s already included in every desktop browser, so there’s nothing to download (see whether you need to install JavaScript on Windows 10). If a site on a PC says it’s off, the fix is a browser setting, as shown for Edge, Chrome and Firefox in enabling JavaScript on Windows 11.
Once the switch is green and your page loads, consider turning your content blockers back on one at a time, so you keep the privacy benefits without breaking the sites you use.

Matt Jacobs writes and maintains the guides on Support Your Tech, which he started in 2017. He spent most of his career keeping small-business PCs running and still takes the occasional consulting job, so the steps here come from fixing the same problems on other people’s computers. Every guide is checked on his own Windows 11, Windows 10, Mac, iPhone and iPad before it goes up.