Embed src property
Example
Return the URL of the embedded file:
var x = document.getElementById("myEmbed").src;
x
The output is:
http://www.w3cschool.cc/jsref/helloworld.swf
Try it »
Definition and Usage
The src property is used to set or return the value of the src attribute of the embed element.
The src property describes the external address (URL) of the embedded file.
Browser support





All major browsers support the src property.
Syntax
Return the src attribute:
embedObject
.src
Set the src attribute:
embedObject
.src=
URL
Attribute values
| Value | Description |
|---|---|
| URL | Describes the external address (URL) of the embedded file |
可能值:
Technical Details
| Return Value: | String, representing the URL of the embedded file, returning the actual URL including the protocol part ( http://) |
|---|
Related pages
HTML Reference Manual: HTML
Embed object