The src
attribute from the embed element
specifies the URL of the external file to embed.
The src
property sets or gets the src attribute in an embed element.
src |
Yes | Yes | Yes | Yes | Yes |
Return the src property.
var v = embedObject.src
Set the src property.
embedObject.src=URL
Value | Description |
---|---|
URL | Specifies the address (URL) of the external file to embed. |
A String type value representing the URL of the embedded file.
The following code shows how to get the URL of an embedded file.
<!DOCTYPE html> <html> <body> <embed id="myEmbed" src="http://example.com/notExist.swf"> <p id="demo"></p> <button onclick="myFunction()">test</button> <script> function myFunction() { var x = document.getElementById("myEmbed").src; document.getElementById("demo").innerHTML = x; } </script> </body> </html>