How to Add JavaScript to Your Website Using HTML
How to Add JavaScript to Your Website Using HTML
This wikiHow teaches you how to include JavaScript in your website's code using HTML.
Steps

Open a simple text editor. Notepad on Windows and TextEdit on Mac are the native text editors that ship with the operating systems. On Windows, type Notepad in the Start menu's search field to locate Notepad on your computer, then click Notepad when it appears in the results. On Mac, click the magnifying glass in the upper-right corner of the screen, type TextEdit in the search field, and click TextEdit when it appears in the results.

Start an HTML block. Include the HTML tags, including the and combination pair, as well as the and combination pair. Include all the tags needed to start the page, as shown:

Add a script tag to the HTML head. To do so, insert a

Call up other JavaScript scripts using a JavaScript function. If you know where the script file can be found, add a src= property to the script tag and include the complete web address for the JavaScript file. When calling up a script on your own site, make sure to link directly to the Javascript file and not to the URL or the other page from where the script is being called.

Click File in the menu bar, and Save As… (Windows) or Save (Mac).

Click .html in the format drop-down.

Name your document and click Save.

Double-click your document to open it in a browser.

What's your reaction?

Comments

https://popochek.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!