Horje

How to create nomodule on HTML <script> Tag

A boolean, true means that the script should not be executed in browsers that support ES modules, false otherwise.
index.html
Example: HTML
<script id="el" nomodule>
  // If the browser supports JavaScript modules, the following script will not be executed.
  console.log("The browser does not support JavaScript modules");
</script>
<script>
const el = document.getElementById("el");
console.log(el.noModule); // Output: true
</script>





Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin