Embed src Property
Example
Return the URL of an embedded file:
var x = document.getElementById("myEmbed").src;
The result of x will be:
http://www.w3schools.com/jsref/helloworld.swf
Try it yourself »
Definition and Usage
The src property sets or returns the value of the src attribute in an embed element.
The src attribute specifies the address (URL) of the external file to embed.
Browser Support
The src property is supported in all major browsers.
Syntax
Return the src property:
embedObject.src
Set the src property:
embedObject.src=URL
Property Values
Value | Description |
---|---|
URL |
Specifies the address (URL) of the external file to embed. Possible values:
|
Technical Details
Return Value: | A String, representing the URL of the embedded file. Returns the entire URL, including the protocol (like http://) |
---|
Related Pages
HTML reference: HTML <embed> src attribute
Embed Object