JavaScript can be placed in the <body> and the <head> sections of an HTML page.
The <script> Tag
In HTML, JavaScript code must be inserted between <script> and </script> tags.
A script can be put anywhere on the page. The most useful places include:
Inside the Head tag of the document
At the bottom of the document, right before closing BODY
..But, generally scripts can be put anywhere.
When the browser renders an HTML-page and finds a <script> tag - it switches into Javascript mode and executes the code inside. Once executed the browser continues rendering the rest of the page.
The <script> Tag
In HTML, JavaScript code must be inserted between <script> and </script> tags.
A script can be put anywhere on the page. The most useful places include:
Inside the Head tag of the document
At the bottom of the document, right before closing BODY
..But, generally scripts can be put anywhere.
When the browser renders an HTML-page and finds a <script> tag - it switches into Javascript mode and executes the code inside. Once executed the browser continues rendering the rest of the page.
No comments:
Post a Comment