If you have any query feel free to chat us!
Happy Coding! Happy Learning!
The <script>
tag in HTML is used to include JavaScript code in a web page. The JavaScript code can be either included inline within the tag or can be specified as an external file.
Here is an example of inline JavaScript code:
phpCopy code
<html>
<head>
<title>Inline JavaScript Example</title>
</head>
<body>
<script>
alert("Hello, world!");
</script>
</body>
</html>
And here is an example of an external JavaScript file included using the <script>
tag:
phpCopy code
<html>
<head>
<title>External JavaScript Example</title>
<script src="my-script.js"></script>
</head>
<body>
...
</body>
</html>
In this example, the my-script.js
file is included in the HTML page using the src
attribute of the <script>
tag. The file my-script.js
should be located in the same directory as the HTML file.
Including JavaScript code in an external file has several advantages, including better organization of code, improved maintainability, and the ability to reuse code across multiple web pages.
Comments: 2
I am not able to access videos from second class and further. I have already completed first class
When will I get my course?
Now, Your query was resolved.