Object name Property
Example
Get the name of an <object> element:
var x = document.getElementById("myObject").name;
The result of x will be:
obj1
Try it yourself »
More "Try it Yourself" examples below.
Definition and Usage
The name property sets or returns the value of the name attribute of an <object> element.
The name attribute specifies the name of an object.
Browser Support
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the name property:
objObject.name
Set the name property:
objObject.name=name
Property Values
Value | Description |
---|---|
name | Specifies the name of the <object> element |
Technical Details
Return Value: | A String, representing the name of the <object> element |
---|
More Examples
Example
Change the name of an <object> element:
document.getElementById("myObject").name = "newObjName";
Try it yourself »
Related Pages
HTML reference: HTML <object> name attribute
Object Object