Home | Top | Website design | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.


SRC Attribute | src Property

Sets or retrieves a URL to be loaded by the object .

Syntax

HTML Scripting
< ELEMENT SRC = sURL ... >
object.src [ = sURL ]

Possible Values

sURL String that specifies or receives the URL.

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties .

Examples

This example uses the src property to change the image's SRC attribute.

<BODY onmousedown="oImage. src ='sphere.jpg'" onmouseup="oImage. src ='cone.jpg'">
<IMG ID=oImage SRC ="cone.jpeg">

This example uses the src property to change the SRC attribute of an iframe .

function changeFrame()
{ alert (document.all.iframe1. src );
document.all.iframe1. src ="http://www.microsoft.com/";
alert (document.all.iframe1. src ); }

Standards Information

This property is defined in HTML 4.0 and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .

Applies To

Platform Version
Win16:
Win32:
Windows CE:
Unix:
Mac:
 
APPLET , EMBED , FRAME , IFRAME , IMG , INPUT type=image , XML
Home | Top | Website design | JavaScript Editor JavaScript EditorGet Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.