The nomodule attribute is a Boolean on <script>. Browsers that support ES modules ignore scripts with nomodule. Older browsers that do not support modules still run them — so you can ship a classic fallback next to type="module".
Typical pattern: modern browsers load the module; legacy browsers skip type="module" (unknown type) and execute the nomodule script instead. Not deprecated — still the standard progressive-enhancement approach for modules.
Baseline · Widely available.
Not deprecated and not experimental. Stable in modern browsers; used so you can support older ones with a fallback.
Boolean — presence turns it on.
nomodule="false" does not disable it. Omit the attribute when the script should run in module-capable browsers.
Syntax
HTML Syntax
syntax.html
<script type="module" src="modern.js"></script>
<script nomodule src="fallback.js"></script>
Write nomodule alone on the classic fallback. Module browsers skip it; legacy browsers run it.
Values
Attribute Values
Boolean attribute — no value list. Behavior by browser capability:
Setup
What happens
Try it
type="module"
Runs in module-capable browsers; ignored by older ones
Only one updates the status text in a given browser.
Modern browsers execute the module block and skip nomodule.
Try It Yourself reloads the pair in a clean document.
Example 3 — Feature Check with noModule
Reflect the attribute in JavaScript and explain what this browser would choose.
HTML
<p id="info"></p>
<script>
var supportsModules = "noModule" in HTMLScriptElement.prototype;
document.getElementById("info").textContent = supportsModules
? "Modules supported — a nomodule script would be skipped."
: "No module support — a nomodule script would run.";
</script>
noModule on the prototype appears in module-capable engines.
true path means this browser would skip nomodule scripts.
false path means the fallback would execute.
Optional:HTMLScriptElement.supports("module") where available.
Edge Cases & Pitfalls
Most mistakes are putting nomodule on the wrong script or expecting both files to run.
pair
Do not put nomodule on the module script
Mark only the classic fallback. The modern file uses type="module" alone.
boolean
nomodule="false" still skips in module browsers
Presence means on. Remove the attribute to allow execution everywhere (classic script).
double
Only one path should run
In a correct pair, you never execute both main.js and fallback.js in the same browser.
build
Fallback must be classic JS
Do not put import/export in the nomodule file — older engines need a bundled classic script.
today
Many sites can ship modules only
If your audience is modern-only, you may skip nomodule. Keep it when you still need a legacy path.
Compatibility
Browser Support
nomodule is an HTML attribute on script elements. It is not a Node.js, Deno, or Bun API.
✓ Baseline · Widely available
nomodule
Supported wherever ES modules are. Module browsers skip nomodule scripts; older browsers without modules still execute them as classic scripts.
96%Global support (approx.)
Google Chrome61+
Full support
Mozilla Firefox60+
Full support
Apple Safari11+
Full support
Microsoft Edge16+
Full support
Opera48+
Full support
Samsung Internet8+
Full support
Internet ExplorerIgnores type=module; runs nomodule
Fallback path
nomoduleWidely supported
Bottom line: Safe to use for module + classic dual delivery. Module-capable browsers skip nomodule; legacy browsers run the fallback.
Remember
Key Takeaways
Role: mark classic scripts that module browsers should skip.
Pair withtype="module" for modern code.
Boolean: present = skip in module engines.
Not deprecated — still the standard module fallback pattern.
One line:nomodule is the classic fallback that module browsers ignore.
Frequently Asked Questions
It is a Boolean attribute on script. Browsers that support ES modules ignore scripts marked with nomodule. Older browsers that do not understand modules will still run those scripts as a fallback.
Put your modern code in <script type="module" src="main.js"> and a classic bundle in <script nomodule src="fallback.js">. Module-capable browsers run only the first; legacy browsers run only the second.
No. It is a current, Baseline widely available attribute for progressive enhancement of module scripts.
No. Boolean attributes are on when present. To run a script in all browsers, omit nomodule (and do not use type="module" if you need classic behavior everywhere).
Yes. Inline <script nomodule>…</script> is skipped in module-capable browsers and executed in browsers that do not support modules.
Check "noModule" in HTMLScriptElement.prototype, or use HTMLScriptElement.supports("module") where available.