Change the URL of the document to embed in the iframe:
The src property sets or returns the value of the src attribute in an iframe element.
The src attribute specifies the URL of the document to show in an iframe.
The src property is supported in all major browsers.
Return the src property:
Set the src property:
Value | Description |
---|---|
URL |
Specifies the URL of the document to embed in the iframe. Possible values:
|
Return Value: | A String, representing the URL of the document that is embedded in the iframe. Returns the entire URL, including the protocol (like http://) |
---|
Get the URL of the document that is shown in an iframe:
The result of x will be:
HTML reference: HTML <iframe> src attribute