You are here: Reference > JavaScript > client-side > event handling > events > onfilterchange

onfilterchange event | filterchange event

Browser support:
Occurs after a filter has changed or finished a transition.
Visual filters and transitions can be set or retrieved with the filter style property or the filter object.

How to register:

<ELEMENT onfilterchange="handler">

In JavaScript:
object.onfilterchange = handler;
object.attachEvent ("onfilterchange", handler);
You can find the related objects in the Supported by objects section below.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
For a complete list of events, see the page for Events in JavaScript.

Basic information:

Bubbles No
Cancelable No
Event object -

Actions that invoke the onfilterchange event:

  • If the value of the filter style property changes.
  • If any property of the filter object changes.
  • If a transition filter finishes.

Example HTML code 1:

This example illustrates the use of the onfilterchange event:
        #mySpan {
            filter:alpha (opacity=34);
    <script type="text/javascript">
        function ChangeFilter (select) {
            var selectedOption = select.options[select.selectedIndex];
            var span = document.getElementById ("mySpan");
            span.filters["alpha"].Opacity = selectedOption.text;

        function OnFilterChanged (elem) {
            var opac = document.getElementById ("opac");
            opac.innerHTML =  elem.filters["alpha"].Opacity;

    <span id="mySpan" onfilterchange="OnFilterChanged (this)">Some text with opacity.</span>
    <br /><br />
    Current opacity: <span id="opac"></span>
    <br /><br />
    Change the opacity:
    <select onchange="ChangeFilter (this)">
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content