Script Tag

Dear Sciaku Learner you are not logged in or not enrolled in this course.

Please Click on login or enroll now button.

If you have any query feel free to chat us!

Happy Coding! Happy Learning!

Lecture 160:- Script Tag

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.

18. Understanding DOM

2 Comments

@niteshguptav63
niteshguptav63 Nov 17, 2024 at 1:39 PM

I am not able to access videos from second class and further. I have already completed first class

@niteshguptav63
niteshguptav63 Nov 16, 2024 at 10:56 AM

When will I get my course?

@admin79
admin79 Nov 17, 2024 at 1:29 PM

Now, Your query was resolved.

Frequently Asked Questions About Sciaku Courses & Services

Quick answers to common questions about our courses, quizzes, and learning platform

Didn't find what you're looking for?

help_center Contact Support