Way of adding JavaScript:
Inline–
- Inside head Tag
- Inside body Tag
Inside Head Tag
Inside Body Tag
External file
- Inside head Tag
- Inside body Tag
Inside head Tag
Inside body Tag
- <script> – Opening Script Tag.
- src – It‟s an attribute of script tag. It defines source/location of script file.
• dev.js – This is our script file. Where dev is file name and .js is the extension
of javascript file.
• type – It‟s an attribute of script tag which tells the browser it is a javascript.
This is optional now a days.
• text/javascript – Its type of document
• document.write(“Hello World”); – This is a function to display data.
• </script> Closing Script tag
Latest posts by rajeshkumar (see all)
- Top 10 Customer Experience (CX) Platforms of 2026 (Reviewed by Experts) - March 24, 2026
- Top 10 Call Center Software Tools in 2026 (Reviewed by Experts) - March 24, 2026
- Global PR Points Calculators – Check Your Immigration Eligibility for Australia, Canada, Austria, Japan, New Zealand, and South Korea - March 14, 2026