You are here: Reference > JavaScript > client-side > HTML DOM > properties > ownerElement (attribute)

ownerElement property (attribute)

Browser support:
8
Returns the element object that contains the current attribute.
Note: Internet Explorer supports the ownerElement property from version 8.

Syntax:

object.ownerElement;
You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

Reference to the element that contains the current attribute.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the ownerElement property:
<head>
    <script type="text/javascript">
        function GetOwner (elem) {
            if ('ownerElement' in elem.attributes[0]) {
                alert (elem.attributes[0].ownerElement);
            } else {
                alert ("Your browser does not support ownerElement property!");
            }
        }
    </script> 
</head>
<body>
    <button onclick="GetOwner (this);">Get ownerElement</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content