classdom::MutationObserver

sys::Obj
  dom::MutationObserver

@Js

MutationObserver invokes a callback when DOM modifications occur.

disconnect

Source

This disconnect()

Disconnect this observer from receiving DOM mutation events.

make

Source

new make(|MutationRec[] callback)

Constructor.

observe

Source

This observe(Elem target, Str:Obj opts)

Register to receive DOM mutation events for given node. At least one option is required:

  • "childList": true to observe node additions and removals on target (including text nodes)
  • "attrs": true to observe target attribute mutations
  • "charData": true to observe target data mutation
  • "subtree": true to observe target and target's descendant mutations
  • "attrOldVal": true to capture attribute value before mutation (requires "attrs":'true')
  • "charDataOldVal": true to capture target's data before mutation (requires "charData":'true')
  • "attrFilter": Str[] whitelist of attribute names to observe (requires "attrs":'true')
takeRecs

Source

MutationRec[] takeRecs()

Empties this observers's record queue and returns what was in there.