Embed srcAttribute
Examples
Returns the URL of the embedded file:
var x = document.getElementById("myEmbed").src;
xThe output is:
http://www.w3cschool.cc/jsref/helloworld.swf
Try it Yourself »
Definition and Usage
The src attribute is used to set or return the value of the src attribute of the embed element.
The src attribute describes the external address (URL) of the embedded file.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the src attribute.
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. Possible values:
|
Technical Details
| Return value: | String, representing the URL of the embedded file. Returns the absolute URL, including the protocol part (http://). |
|---|
Related Pages
HTML Reference Manual:HTML <embed> src Attribute
Embed Object Other Extensions