We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
MutationObserverInit.attributeFilter
n/a
lib.dom
MutationObserverInit
The following code works in Chredge, Firefox, and Safari:
const obs = new MutationObserver((records) => { console.log(...records) }) const s = new Set(['foo', 'bar']) obs.observe(document.body, { attributeFilter: s.keys() // <--------- HERE }) document.body.setAttribute('foo', 'foo') document.body.removeAttribute('foo') document.body.setAttribute('bar', 'bar') document.body.removeAttribute('bar')
Edge screenshot:
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe#parameters
⚙ Compilation target
n/a
⚙ Library
lib.dom
Missing / Incorrect Definition
MutationObserverInitSample Code
The following code works in Chredge, Firefox, and Safari:
Edge screenshot:
Documentation Link
https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver/observe#parameters
WIP Pull Request
MutationObserverInit.attributeFiltercan accept an iterator #55989