Sie sind auf Seite 1von 1

Coding Exercise - Write a Simple JavaScript Program

Please perform below steps:

1. Create an exercise folder.


2. Create HTML file (i.e. index.html) with basic standard HTML template and save it inside the
exercise folder.
3. Add script tag just before the body closing tag as demonstrated in lecture.
4. The script tag should point to an external JavaScript file (i.e. myScript.js) using src attribute.
5. Create an external JavaScript file (i.e. myScript.js) and save it inside exercise folder.
6. Open external JavaScript file and start writing JavaScript statements.
7. Add JavaScript statement to popup your name using alert method.
8. Save file and insure the browser output.

Browser Output:

9) Now comment out alert statement using single line comment.

10) Write/Output your name using document.write statement.

11) Save file and insure the browser output.

Browser Output:

Das könnte Ihnen auch gefallen