Categories
- HTML Books
- HTML Colors
- HTML Characters
- HTML Tags
- <!--...-->
- <!doctype>
- <a>
- <abbr>
- <acronym>
- <address>
- <applet>
- <area>
- <b>
- <base>
- <basefont>
- <bdo>
- <big>
- <blockquote>
- <body>
- <br>
- <button>
- <caption>
- <center>
- <cite>
- <code>
- <col>
- <colgroup>
- <dd>
- <del>
- <dfn>
- <dir>
- <div>
- <dl>
- <dt>
- <em>
- <fieldset>
- <font>
- <form>
- <frame>
- <frameset>
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- <head>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <isindex>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <map>
- <menu>
- <meta>
- <noframes>
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <p>
- <param>
- <pre>
- <q>
- <s>
- <samp>
- <script>
- <select>
- <small>
- <span>
- <strike>
- <strong>
- <style>
- <sub>
- <sup>
- <table>
- <tbody>
- <td>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <title>
- <tr>
- <tt>
- <u>
- <ul>
- <var>
- HTML Tutorial
- HTML Software
- HTML Validator
Tools
Partners
HTML <script> Tag
Description:
The <script> tag is used for declaring a script (such as JavaScript) within your HTML document.
Specific Attributes:
| Attribute | Definition |
| name | Defines the name of the parameter. |
| src | Specifies a URI/URL of an external script. |
| type | Specifies the scripting language as a content-type (MIME type). |
| language | Specifies the scripting language, however, this attribute has been deprecated. Use the type attribute instead. |
| defer | Declares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page. |
Other Attributes:
| Attribute | Definition |
| charset | Defines the character encoding that the script uses. |
Example Code:
<script type="text/javascript">
document.write("Hello World!")
</script>
Result



