How to add Javascript to your site using HTML

Table of contents:

How to add Javascript to your site using HTML
How to add Javascript to your site using HTML
Anonim

This article will show you how to use Javascript on your website. Notepad will be used to edit HTML code.

Steps

Create Bold Text With HTML Step 1
Create Bold Text With HTML Step 1

Step 1. Open Notepad

To do this, press Windows + R and then type notepad and press Enter. Or click Start> Accessories> Notepad.

Create Bold Text With HTML Step 2
Create Bold Text With HTML Step 2

Step 2. Enter the following lines (as shown in the picture)

Add JavaScript to Your Website Using Html Step 3
Add JavaScript to Your Website Using Html Step 3

Step 3. After the tag, enter a string

… If you want the script to run automatically when the site loads, do not use the function. Otherwise, use the function. In our example, we will notify the user.

alert ("Hello and welcome.")

Add JavaScript to Your Website Using Html Step 4
Add JavaScript to Your Website Using Html Step 4

Step 4. Use the function

Add JavaScript to Your Website Using Html Step 5
Add JavaScript to Your Website Using Html Step 5

Step 5. Save the text document as.html to convert it to a web page

Double click on the icon to load the page and an alert window will appear.

Popular by topic