222k views
1 vote
3 Dete Paga How can you add JavaScript to an HTML page? Iulstrate with the example.​

User Yo Momma
by
8.0k points

1 Answer

4 votes

Answer:

You can do it inline:

(script type="text/javascript")

alert("Hi!");

(/script)

or use an external javascript file:

(script type="text/javascript" src="myhello.js")(/script)

Step-by-step explanation:

You can place these script tags inside the head or the body section.

See picture for actual tags.

3 Dete Paga How can you add JavaScript to an HTML page? Iulstrate with the example-example-1
User StanE
by
9.0k points