Your Title Goes Here

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.

Your Title Goes Here

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.

External JavaScript

If you are going to define a functionality which will be used in various HTML documents then it’s better to keep that functionality in a separate JavaScript file and then include that file in your HTML documents. A JavaScript file will have extension as .js and it will be included in HTML files using <script> tag.

Note: Do not add <script> tag in the external file, and provide the complete path where you have put the JS file.

Example – HTML File

<!DOCTYPE html>
<html>
 
   <head>
      <title>This page title</title>
      <script src = "https://www.lecturely.com/wp-content/themes/divi-child/asset/external.js" type = "text/javascript"/></script>
   </head>
   <body>
      <input type = "button" onclick = "Hello();" name = "ok" value = "Click Me" />
   </body>
</html>

Example – External Script File

function Hello() {
   alert("Hello, Javascript World");
}

Output