There are no tracking or monitoring cookies on this site. There are only cookies used for documentation examples related to cookies.
Close

Processing...
This may take a few seconds.

The "innerhtmlchange" event

This is a custom Active CSS event (introduced in 2.10.0) that can be used to monitor inner html changes as they occur in the DOM.

Changes with the innerHTML property of an element will trigger the innerhtmlchange event for that element (or set of elements).

 

Note that there is also an if-inner-html conditional (which can be shortened to inner-html when used with @if statements). That can be used to check the new value of the inner HTML from the innerhtmlchange event.

 

Fun fact: If you type class='green' to display an element, with single quotes, the browser will convert it to class="green" when it puts it onto the page. It's a browser thing. Interesting, huh? You can try it from DevTools.

When checking for double quotes inside an if-inner-html conditional, always use a backslash on the inner quotes. This is demonstrated in the example below.

 

The innerhtmlchange event