Max Design

Published:

The DOM is a tree-like structure that shows all the elements in your HTML document.

It is live", which means it reacts to changes. It is not a passive version of your HTML.

"DOM mutations" are any changes that happen to this tree. These mutations can happen with or without JavaScript.

Browsers constantl check and modify the DOM to reflect things like:

None of these modifications need to be made using JavaScript. Many HTML elements have built-in behaviours. This means that browsers have to update the DOM to keep a range of things "in sync". This includes the element’s internal state, visual UI, and accessibility information.

Here are some quick examples you can try yourself:

  1. When you type into an <input>, the browser updates the element’s value property.
  2. When you select an option in a <select>, the DOM automatically updates which option is selected.
  3. When a <details> element opens, the browser sets the open attribute on the <details> element automatically.

JavaScript and the DOM

JavaScript can also be used for DOM mutations.

When your script runs, it can directly change the structure, text, or attributes of elements — and every one of these changes counts as a DOM mutation.

Typical JavaScript-driven mutations include:

These are sometimes called “JavaScript-driven DOM mutations” or “JS mutations”, but they are not really a special category — just another way the DOM changes.

Why DOM mutations matter for accessibility

Every DOM mutation means that browsers need to update the accessibility tree (AXTree). Screen readers and other assistive technologies use this tree.

Whenever the DOM changes:

These AXEvents then travel through the operating system’s accessibility API to the screen reader, which interprets them and decides whether, when, and how to announce the change.

Not all AXEvents result in announcements — screen readers may merge, delay, or ignore certain events based on their behaviour and user settings.

If we return to our previous three examples, we can see that they all push information into the AXTree:

These updates happen because the browser does not keep a separate copy of your original HTML. Instead, it continuously updates accessibility information from the live, constantly changing DOM.

Why this matters

DOM mutations have a directly influence over the following:

Every DOM mutation means that browsers have to update accessibility information and fire accessibility events.

Wrapping up


Related articles

What happens when an event occurs? — the quick answer
Ever wondered how a browser turns an interaction into a screen reader announcement?

What is an AXEvent?
Detailed explanation of AXevents.

What really happens when a user clicks an accordion button?
A more detailed explanation of an event.

End-to-end browser and accessibility event architecture
A full explanation of how browsers and assistive technologies communicate.


Footnotes