HTML DOM Embed src attribute
Examples
Returns the embedded file URL:
var x = document.getElementById("myEmbed").src;
x The output is:
http://www.w3cschool.cc/jsref/helloworld.swf
try it"
Definition and Usage
src attribute is used to set or return the value embed src attribute of the element.
src attribute describes the embedded files external address (URL).
Browser Support
All major browsers support the src attribute.
grammar
Back src attribute:
embedObject .src
Setting the src attribute:
embedObject .src= URL
Property Value
值 | 描述 |
---|---|
URL |
描述了嵌入文件的外部地址 (URL) 可能值:
|
technical details
return value: | String representing the URL embedded in the file, return entity URL, contains the protocol part (http: //) |
---|
Related Pages
HTML Reference Manual: HTML <the embed> the src attribute
Embed the object