oldValue property
Retrieves the previous value of the attribute or characterData that was mutated (or null otherwise)..
This property is read-only.
![]() |
Syntax
| JavaScript |
|---|
ptr = object.oldValue |
Property values
Type: DOMString
Remarks
If the MutationRecord is of type attributes, you can use its attributeName property to identify the specific attribute that changed. If you registered (via the MutationObserver.observe method) to collect attributeOldValue data on your target node, the oldValue property provides the original attribute value before it was changed.
If the MutationRecord is of type characterData and you registered (via the MutationObserver.observe method) to collect characterDataOldValue data on your target node, the oldValue property provides the original text data before it was changed.
See also
Show:
