asp.net.ph

Skip Navigation Links

onpropertychange Event


Fires when a property changes on the object.

Syntax

Inline <element onpropertychange = "handler" ... >
Script object.onpropertychange = handler

Remarks

Bubbles No
Cancels No
To invoke Cause a property to change value.
Default action Sends notification when a property changes.

This event is equivalent to the generic DOMAttrModified event as specified in the DOM Level 2 Event Model.

The onpropertychange event fires when any property of an object, expando, or style subobject change. The name of the property that has changed can be retrieved using the propertyName attribute of the event object.

propertyName returns a read-only string of the name of the property that has changed. In the case of style properties, the property name will be prefixed with style. For example, if the CSS property pixelLeft is altered, the value of window.event.propertyName is style.pixelLeft. By contrast, if the non-CSS property name is altered, the value of window.event.propertyName is name.

When the onpropertychange event fires, the srcElement property of the event object is set to the object whose property has changed.

Event Object Properties

While event handlers in the Document Object Model do not receive parameters directly, the handler can query the event object for data.

Event Object Properties


Example

The example demonstrates the use of onpropertychange, srcElement, and propertyName for both an object and a style subobject property.

Sample Code


See Also

propertyName, srcElement


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note