341Chapter 15Generic HTML Element Objects} onfilterchange Event Handler (Web hosting compare)

341Chapter 15Generic HTML Element Objects}

onfilterchange Event Handler


The completion of the first transition ( circle-in ) triggers thesecond ( circle-out ).

image

Related Item:filterobject. onfocusCompatibility:WinIE3+, MacIE3+, NN2+, Moz1+, Safari1+ The onfocusevent fires when an element receives focus, usually following some other objectlosing focus. (The element losing focus receives the onblurevent before the current objectreceives the onfocusevent.) For example, a text input element fires the onfocusevent whena user tabs to that element while navigating through a form via the keyboard. Clicking an ele- ment also gives that element focus, as does making the browser the frontmost application onthe client desktop. The availability of the onfocusevent has expanded with succeeding generations of script- capable browsers. In earlier versions, blur and focus were largely confined to text-orientedinput elements such as the selectelement. The windowobject received the onfocuseventhandler starting with NN3 and IE4. IE4 also extended the event handler to more form ele- ments, predominantly on the Windows operating system because that OS has a user interfaceclue (the dotted rectangle) when items such as buttons and links receive focus (so that usersmay act upon them by pressing the keyboard s spacebar). For IE5+, the onfocusevent han- dler is available to virtually every HTML element. For most of those elements, however, you cannot use blur and focus unless you assign a value to the tabindexattribute of the element s tag. For example, if you assign tabindex= 1 inside a

tag, the user can bringfocus to that paragraph (highlighted with the dotted rectangle in Windows) by clicking theparagraph or pressing the Tab key until that item receives focus in sequence. WinIE5.5 adds the onactivateevent handler, which fires immediately before the onfocusevent handler. You can use one or the other, but there is little need to include both event han- dlers for the same object unless you temporarily wish to block an item from receiving focus. Toprevent an object from receiving focus in IE5.5+, include an event.returnValue=falsestate- ment in the onactivateevent handler for the same object. In other browsers, you can usuallyget away with assigning onfocus= this.blur() as an event handler for elements such aselementObject.onfocus