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)
- The Three Pillars of Digital Resilience in 2025: Database Administration, Cybersecurity, and Vulnerability Assessment - September 24, 2025
- Avionics Technician: The Backbone of Modern Aviation - September 12, 2025
- Top 20 Computer Vision Libraries - August 26, 2025