• USA : +1 973 910 5725
  • INDIA: +91 905 291 3388
  • info@tekslate.com
  • Login

HTML Script Tags

HTML Script Tag

A script is a small piece of program that can add interactivity to your website. For example, a script could generate a pop-up alert box message, or provide a dropdown menu. This script could be Javascript or VBScript.

You can write your Event Handlers using any of the scripting language and then you can trigger those functions using HTML attributes.

External Script

If you have to use a single script functionality among many HTML pages then it is a good idea to keep that function in a single script file and then include this file in all the HTML pages. You can incluse a style sheet file into HTML document using <script> element. Below is an example.

<head>

<script src=”yourfile.js” type=”text/javascript” />

</head>

Internal Script

You can write your script code directly into your HTML document. Usually we keep script code in header of the document using <script> tag. otherwise there is no restriction and you can put your source code anywhere in the document. You can specify where to make a script run automatically(as soon as the page loads), or after he user has done something(like click on a link). Below is an example this would write a Hello Javascript! message as soon as the page loads:

<head>

<title> internal script></title>

</head>

<body>

<script type=”text/javascript”>

alert(“Hello Javascript!”)

</script>

</body>

This will produce following result :

Hello Javascript!

Summary
Review Date
Reviewed Item
HTML Table Tags
Author Rating
5

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on HTML Script Tags"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Site Disclaimer, Copyright © 2016 - All Rights Reserved.

    Support


    Please leave a message and we'll get back to you soon.

    I agree to be contacted via e-mail.