asp.net.ph

onpropertychange Event

DHTML Events


Fires when a property changes on the object.

Syntax


Inline HTML <element onpropertychange = "handler" ... > All platforms
Event property object.onpropertychange = handler ECMA-262 Language Specification
Named script <script FOR=object EVENT = onpropertychange> Internet Explorer® only

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




Contents
HTML Elements
HTML Element Attributes
CSS Attributes
DOM Objects
DOM Object Properties
DOM Events Reference
DOM Methods Reference
DOM Collections Reference
 

Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph