script element
Specifies a script block within a HTML document.
The script element allows authors to write or include script codes into HTML documents.
Use the type attribute to specify the language for a script block.
If the type attribute is not specified (it was only required in older browsers), JavaScript (JScript) is the basic interpreter for the code.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
JavaScript page for this element: script. |
Possible members:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Example HTML code 1:
This example illustrates the use of the script element:
|
||||
<head> <script type="text/javascript"> window.onload = alert ("Fires onload event."); </script> </head> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example shows how to link a .js (JavaScript) file into a HTML document:
|
|||
<head> <script type="text/javascript" src="sample.js"></script> </head> |
|||
|
|||
Did you find this example helpful?
|
Related pages:
External links:
User Contributed Comments