This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

propertyName

Summary

Specifies or retrives a string containg the name of the changed property.

Property of dom/TransitionEventdom/TransitionEvent

Syntax

Note: This property is read-only.

var result = object.propertyName;

Return Value

Returns an object of type StringString

The name of the CSS property associated with the transition.

Examples

This example uses the onpropertychange event to change the value of the propertyName property. This example needs to be run on IE prior to version 9 in order to work properly.

<!DOCTYPE html>
<html lang="en">
<head>
<script>
    function inform() {
        //Get propertyName property
        alert(event.propertyName + " property has changed value");
    };

    function changeProperty() {
        btnProp.value = "This is the new VALUE";
    };

    function changeCSSProperty() {
        btnStyleProp.style.backgroundColor = "aqua";
    };
</script>
</head>
<body>
    <p>The event object property propertyName is used here to return which property has been altered.</p>
    <input
      id="btnProp"
      type="button"
      value="Click to change the VALUE property of this button"
      onclick="changeProperty()"
      onpropertychange="inform()"
    />
    <input
      id="btnStyleProp"
      type="button"
      value="Click to change the CSS backgroundColor property of this button"
      onclick="changeCSSProperty()"
      onpropertychange="inform()"
    />
</body>
</html>

View live example

Notes

Remarks

You can alter the value of propertyName by using it with the onpropertychange event that is available only on IE<9.

Syntax

See also

Related articles

Javascript

Attributions