Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

HTMLScriptElement: noModule property

ThenoModule property of theHTMLScriptElement interface is a boolean value that indicates whether the script should be executed in browsers that supportES modules. Practically, this can be used to serve fallback scripts to older browsers that do not support JavaScript modules.

It reflects thenomodule attribute of the<script> element.

Value

A boolean,true means that the script should not be executed in browsers that support ES modules,false otherwise.

Examples

html
<script nomodule>  // If the browser supports JavaScript modules, the following script will not be executed.  console.log("The browser does not support JavaScript modules");</script>
js
const el = document.getElementById("el");console.log(el.noModule); // Output: true

Specifications

Specification
HTML
# dom-script-nomodule

Browser compatibility

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp