src attribute of the script tag (XHTML 1.1)

URI for an external script

The src attribute of the script tags allow you to include an external file and have it interpreted along with the current document. This allows you to have large quantities of scripting code placed elsewhere, so that it doesn't clutter up your HTML files. Here's an example, where we include a JavaScript file from the same directory, into our page:

 

<script type="text/javascript" src="javascript.js"></script>

You can refer to variables, functions etc. from the external file as if they were written directly in the script block.

Possible values

Value
<url>

src exists in these tags

Attribute Deprecated Description
applet Java applet 
frame subwindow 
iframe inline subwindow 
img Embedded image 
input form control 
script script statements 



© htmlpedia.net 2008 - 2012