HTMLforall

  HTML | PHP | Forum

HTML <script> tag

Syntax

<script> - </script>

Definition and Usage

The SCRIPT element specifies a script for the page that is interpreted by a script engine, such as java script.

Required Attributes

Attribute Value Description
type text/ecmascript
text/javascript
text/jscript
text/vbscript
text/vbs
text/xml
Indicates the MIME type of the script

Optional Attributes

Attribute Value Description
charset charset Defines the character encoding used in script
defer defer Indicates that the script is not going to generate any document content. The browser can continue parsing and drawing the page
language javascript
livescript
vbscript
other
Specifies the scripting language. Deprecated. Use the type attribute instead.
src URL Defines an URL to a file that contains the script (instead of inserting the script into your HTML document, you can refer to a file that contains the script)

Standard Attributes

xml:space

For a full description, go to Standard Attributes.

Example

Source Output
<SCRIPT type="text/javascript"><!--
document.write("/cgi-bin/connect.cgi?");
document.write("usr=00027147P500");
document.write("&refer="+escape(document.referrer)+"");
document.write("&tips="+Math.random()+"");
file://--></SCRIPT>
 

Home

Learn HTML
HTML Tutorial

HTML Reference
HTML by function
HTML by Alphabet

HTML events
HTML attributes
HTML color names

Top-Level Elements
<!--...-->
<!DOCTYPE> 
<html>
<head>
<body>
<frameset>
Head Elements
<base>
<isindex>
<link>
<meta>
<script>
<style>
<title>
Generic Block-level Elements
<address>
<blockquote>
<center>
<del>
<div>
<h1> to <h6>
<hr>
<ins>
<isindex>
<noscript>
<p>
<pre>
Lists
<dd>
<dir>
<dl>
<dt>
<li>
<menu>
<ol>
<ul>
Tables
<caption>
<col>
<colgroup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<tr>
Forms
<button>
<fieldset>
<form>
<input>
<label>
<legend>
<option>
<optgroup>
<select>
<textarea>
Special Inline Elements
<a>
<applet>
<area>
<basefont>
<bdo>
<br>
<font>
<iframe>
<img>
<map>
<object>
<param>
<q>
<script>
<span>
<sub>
<sup>
Phrase Elements
<abbr>
<acronym>
<cite>
<code>
<del>
<dfn>
<em>
<ins>
<kbd>
<samp>
<strong>
<var>
Font Style Elements
<b>
<big>
<i>
<s>
<small>
<strike>
<tt>
<u>
Frames
<frame>
<frameset>
<noframes>

 

Copyright 2005-8 Sunilcare.  All Rights Reserved.
Comments or suggestions? Contact us.About us