# Frame/IFrame src Attribute
[ Frame/IFrame Object](#)
* * *
## Definition and Usage
The src attribute can set or return the value of the src attribute in a frame/iframe element.
The src attribute specifies the URL of the document to be loaded into the frame/iframe.
## Syntax
frameObject.src=_URL_
or
iframeObject.src=_URL_
* * *
## Browser Support

The src attribute is supported by all major browsers.
* * *
## Example
## Example
Change the src attribute in an iframe:
function changeSrc(){
document.getElementById("myframe").src="http://www.baidu.com";
}
Your browser does not support iframes.
[Try it Yourself Β»](#)
* * Frame/IFrame Object](#)