Skip to end of metadata
Go to start of metadata

The onblur event activates when an element loses focus.  The event can be specified as a JavaScript expression or the name of a JavaScript function.  

If an expression is used, the JavaScript keyword this refers to the element that lost focus.  

If the name of a function is used, the function will receive 2 parameters when called: 

  • The browser event object
  • A reference to the element that lost focus


The following would draw a red border around the element with focus.  When the element loses focus, the border is removed.

onfocus: = "1px solid red";

onblur: = "";

  • No labels