Example
Get the URL of the object:
var x =
document.getElementById("myObject").data;
The result of x will be:
http://www.w3ii.com/jsref/helloworld.swf
Try it Yourself »
Definition and Usage
The data property sets or returns the value of the data attribute of an <object> element.
The data attribute specifies the URL of the resource to be used by the object.
Browser Support
Property | |||||
---|---|---|---|---|---|
data | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the data property:
objObject.data
Set the data property:
objObject.data=URL
Property Values
Value | Description |
---|---|
URL |
Specifies the URL of the resource to be used by the object. Possible values:
|
Technical Details
Return Value: | A String, representing the URL of the object. Returns the entire URL, including the protocol (like http://) |
---|
Related Pages
HTML reference: HTML <object> data attribute
< Object Object