Answers for "where to put js in html"

1

how to use js in html

<script>
  function alert () {
    alert("Javascript has started");
  }
</script>
Posted by: Guest on September-08-2021
6

how to put javascript in HTML

<script>
  //put your java script here
  </script>
Posted by: Guest on March-21-2021
2

best place to include script in html layout

JavaScript in <head> or <body>
You can place any number of scripts in an HTML document. Scripts can be placed in the <body> , or in the <head> section of an HTML page, or in both.
Posted by: Guest on June-20-2020
0

How to add js file to a site through url

var jsFile = document.createElement("script");
jsFile.src = "homePage.js";  // it can be path also  "{themes('/scripts/homePage.js')}"
document.body.appendChild(jsFile);  //append it as src to body
Posted by: Guest on October-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language