You can add an inline script at any place within an HTML document, but most web developers like to place the scripts in three locations.
You have already seen examples of online scripts in exercise 1, exercise 2 and exercise 3.
main.js. Then create HTML file called
ex04.html and link the
Step 1: Create a folder called
" on your Windows desktop.
Step 2: Open the folder,
" and create a text file and save it as
Step 3: Open the file
Step 4: Close the file.
Step 1: Create a new text document called
"ex04.txt" in the
Exercise-04 folder on your Windows desktop.
Step 2: Open the text file and insert the following code and save the file as
"ex04.html" in the same location.
ex04.html file using following code.
Step 4: Save and close the file.
The final html page should look like the following.
Output to the Browser
onload = "message()" from the tag.