src attribute | src property

all
alt
ch
dir
id
min
rel
top
url
URL
urn
Expand Minimize
This topic has not yet been rated - Rate this topic

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

Syntax

HTML<element src="p" ... >
JavaScript

p = object.src

Property values

Type: String

the URL.

Examples

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);
}

See also

embed
iframe

 

 

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.