MutationRecord - Web APIs 编辑
A MutationRecord
represents an individual DOM mutation. It is the object that is passed to MutationObserver
's callback.
Properties
Property | Type | Description |
MutationRecord.type | String | Returns "attributes" if the mutation was an attribute mutation,"characterData" if it was a mutation to a CharacterData node,and "childList" if it was a mutation to the tree of nodes. |
MutationRecord.target | Node | Returns the node the mutation affected, depending on the MutationRecord.type .For attributes , it is the element whose attribute changed.For characterData , it is the CharacterData node.For childList , it is the node whose children changed. |
MutationRecord.addedNodes | NodeList | Return the nodes added. Will be an empty NodeList if no nodes were added. |
MutationRecord.removedNodes | NodeList | Return the nodes removed. Will be an empty NodeList if no nodes were removed. |
MutationRecord.previousSibling | Node | Return the previous sibling of the added or removed nodes, or null . |
MutationRecord.nextSibling | Node | Return the next sibling of the added or removed nodes, or null . |
MutationRecord.attributeName | String | Returns the local name of the changed attribute, or null . |
MutationRecord.attributeNamespace | String | Returns the namespace of the changed attribute, or null . |
MutationRecord.oldValue | String | The return value depends on the Note that for this to work as expected, |
Specifications
Specification | Status | Comment |
---|---|---|
DOM The definition of 'MutationRecord' in that specification. | Living Standard |
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论