Three are 3 place we can put our javascript code: 1) In head /* html head script type="text/javascript" /script /head /html */ 2) In body /*html body script type="text/javascript" /script /body /head */ 3) external in HTML file /*html head script src="myscript.js" /script /head /html */
Where u can put ur javascript code?
ReplyDeleteThis comment has been removed by the author.
DeleteWe can put java script in
Delete1. Head
2. Body
3. External to HTML file
This comment has been removed by the author.
DeleteThree are 3 place we can put our javascript code:
Delete1) In head
/* html
head
script type="text/javascript"
/script
/head
/html
*/
2) In body
/*html
body
script type="text/javascript"
/script
/body
/head
*/
3) external in HTML file
/*html
head
script src="myscript.js"
/script
/head
/html
*/
i] In "head" section (javascript will run before the body portion for dynamic content)
Deleteii] In "body" section (when we want to use in some or all part of webpage)
iii] With an external file (when we want to use script in multiple webpage)
JavaScript code can be placed in the body and the head sections of an HTML page and also EXTERNAL to the html file..
Delete1) after head tag
ReplyDelete2)after body tag
3)external to the html file..
1)
ReplyDeletein body
body
script type ="text/javascript"
script statment
/script
/body
2)
in head element
head
script type="text/javascript"
/script
/head
3)
head
script src="filename.js"
/script
/head