blur method
[This documentation is preliminary and is subject to change.]
Causes the element to lose focus and fires the onblur event.
![]() |
Syntax
object.blur()Standards information
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
Parameters
This method has no parameters.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
This method shifts focus away from the element it is applied to but does not set focus on the next element in the tab order.
In Microsoft Internet Explorer 5 and greater, elements that expose the blur method must have the TABINDEX attribute set.
See also
- a
- abbr
- acronym
- address
- applet
- area
- article
- aside
- b
- bdo
- big
- blockQuote
- body
- button
- caption
- center
- cite
- custom
- dd
- del
- dfn
- dir
- div
- dl
- dt
- em
- embed
- fieldSet
- figcaption
- figure
- font
- footer
- form
- frame
- frameSet
- header
- hgroup
- hn
- hr
- i
- iframe
- img
- input type=button
- input type=checkbox
- input type=file
- input type=image
- input type=password
- input type=radio
- input type=reset
- input type=submit
- input type=text
- ins
- isIndex
- kbd
- label
- legend
- li
- listing
- mark
- marquee
- menu
- nav
- object
- ol
- p
- plainText
- pre
- q
- rt
- ruby
- s
- samp
- section
- select
- small
- span
- strike
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- tr
- tt
- u
- ul
- var
- window
- xmp
- focus
Build date: 3/8/2012
If the following secuence of events ocurrs, blur just doesn't work.
1.- Set focus to a input type=text control.
2.- Issue a XMLHttpRequest call to the server.
3.- In response to onreadystatechange event call obj.blur().
You will notice that the caret keeps blinking.
The work arround is quite simple yet hard to figure out. You just add the following code after obj.blur()
window.focus()
This is true for IE7, I don't know yet if the problem still exist on IE8 and if it does, I don't know there's a work arround.
- 10/28/2009
- george_5154
- 10/28/2009
- george_5154
