propertyName property

Sets or retrieves the name of the property that changes on the object.

Syntax

JavaScript

p = object.propertyName

Property values

Type: String

the name of the property whose value changes during the event.

Remarks

You can alter the value of propertyName by using it with the onpropertychange event.

Examples

This example uses the onpropertychange event to change the value of the propertyName property.


<HEAD>
<SCRIPT>
function changeProp()
{
    btnProp.value = "This is the new VALUE";
}

function changeCSSProp()
{
    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 TYPE=button ID=btnProp onclick="changeProp()"
       VALUE="Click to change the VALUE property 
       of this button"
       onpropertychange='console.log(event.propertyName + " 
       property has changed value")'>
<INPUT TYPE=button ID=btnStyleProp
       onclick="changeCSSProp()"
       VALUE="Click to change the CSS backgroundColor 
       property of this button"
       onpropertychange='console.log(event.propertyName + " 
       property has changed value")'>
</BODY>

See also

event
onpropertychange

 

 

Send comments about this topic to Microsoft

Build date: 11/14/2012

Show:
© 2014 Microsoft. All rights reserved.