Internal JavaScript

  1. First of all, make a local copy of our example file apply-javascript.html. Save it in a directory somewhere sensible.
  2. Open the file in your web browser and in your text editor. You'll see that the HTML creates a simple web page containing a clickable button.
  3. Next, go to your text editor and add the following in your head — just before your closing </head> tag:

Ref: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript

  1. Now we'll add some JavaScript inside our <script> element to make the page do something more interesting — add the following code just below the "// JavaScript goes here" line:

Ref: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript

  1. Save your file and refresh the browser — now you should see that when you click the button, a new paragraph is generated and placed below.

Live web: https://gitthuma.github.io/internal-javascript/