when the user leaves a form field). The HTML DOM onblur event occurs when an object loses focus. Os eventos se chamam onfocus e onblur na forma de propriedade de um elemento do HTML. The blur event is raised when an element loses focus. onBlur : The form's select, text, or textarea field loses focus. Learn html - html tutorial - Onfocus attribute in html - html examples - html programs. Supported elements . would work. Please note that we can’t “prevent losing focus” by calling event.preventDefault() in onblur, because onblur works after the element lost the focus. It's available on Element , Document , and Window . When you use HTML forms it … It works in all browsers except Firefox ().If we enter something into the input and then try to use Tab or click away from the , then onblur returns the focus back.. BraveBrain - good call but if someone starts at the beginning and tabs through, elements that don't change stay highlighted. The onblur hook appears to correctly stop all other event processing while it's running, so there's a window of opportunity here to do the right thing. onFocus is the event handler for when the input field gets the focus. Onfocus is best often used with , ,