
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Object name Property
The HTML DOM Object name property sets or returns the value of the name attribute. However, the name attribute only sets the name.
Following is the syntax to set the object name property −
obj.name
Following is the syntax to return the object name property −
obj.name = name
Let us now see an example to implement the DOM Object name property −
Example
<!DOCTYPE html> <html> <body> <object id="obj1" width="570" height="350" data="https://www.tutorialspoint.com/flex/samples/CSSApplication.swf" name="obj"></object> <button onclick="display()">Change the object name</button> <p id="demo"></p> <script> function display() { document.getElementById("obj1").name = "obj2"; document.getElementById("demo").innerHTML = "Name updated to obj2"; } </script> </body> </html>
Output
Now, click the button to update the object name −
- Related Articles
- HTML DOM name Property
- HTML DOM Object Height Property
- HTML DOM Object Width Property
- HTML DOM Object type Property
- HTML DOM Object data Property
- HTML DOM Object form Property
- HTML DOM Button name Property
- HTML DOM Textarea name Property
- HTML DOM Form name Property
- HTML DOM Fieldset name property
- HTML DOM Select name Property
- HTML DOM Input Submit object property
- HTML DOM Input URL name Property
- HTML DOM Input Week name Property
- HTML DOM Input Password name Property

Advertisements