onBlur (Event handler)

Triggered when the user selects another form element for input and the current one loses focus.

Availability:

JavaScript - 1.1
JScript - 3.0
Internet Explorer - 3.0
Netscape - 2.0
Opera browser - 3.0
Property/method value type:Boolean primitive
JavaScript syntax:-myObject.onblur = aHandler
HTML syntax:<BODY onBlur="aHandler"> <FRAMESET onBlur="aHandler"> <HTMLTag onBlur="aHandler"> <INPUT onBlur="aHandler">
Argument list:aHandlerA reference to a function object to handle the event
Supported by objects:A, Anchor, APPLET, AREA, BUTTON, CAPTION Checkbox, DIV, Embed, FIELDSET, FileUpload, IMG, Input, Layer, LEGEND, MARQUEE, OBJECT, Password, RadioButton, ResetButton, Select, SPAN, SubmitButton, TABLE, TD, TEXTAREA, TextCell, TH, TR, Url

A blur event is caused by the user clicking on another window or frame, or the blur() method being called for an object. When this event is triggered, an onBlur event handler will be invoked.

The onblur event handler is a function, which is represented by an object that is referred to by this property. Because it is stored in a property, you can change the handler by storing a reference to a different function object in this property. At least, you can on MSIE.

You cannot redefine the value of the window.onblur property from inside the onblur function handler. This means you can't modify the onblur behavior while a blur event is in progress.

Netscape will pass an Event object as an argument when it calls this event handler function. MSIE does not pass an object but makes the event data available via the Event object that is stored and accessed globally for all events.

DOM level 2 refers to this as a DOMFocusOut event, which employs event bubbling for its propagation and cannot be canceled.

Warnings:

See also:Event, Event handler, Event model, Event names, Event object, Event.returnValue, Handler, Input.blur(), Input.focus(), onFocus, Password object, Semantic event, UIEvent object, Window.onblur