当前位置: 代码迷 >> JavaScript >> 让文本框获得焦点的方法是txt1.focus(),那失去焦点的方法是什么?该怎么处理
  详细解决方案

让文本框获得焦点的方法是txt1.focus(),那失去焦点的方法是什么?该怎么处理

热度:593   发布时间:2012-03-13 11:21:10.0
让文本框获得焦点的方法是txt1.focus(),那失去焦点的方法是什么?
rt

------解决方案--------------------
blur
------解决方案--------------------
onblur 在对象失去输入焦点时触发。
------解决方案--------------------
blur Method Internet Development Index

--------------------------------------------

Causes the element to lose focus and fires the onblur event.

Syntax

object.blur()
Return Value

No return value.

Remarks

This method shifts focus away from the element to which it is applied, but this does not set focus on the next element in the tab order.

As of Microsoft® Internet Explorer 5, elements that expose the blur method must have the TABINDEX attribute set.

Standards Information

This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .

------解决方案--------------------
obj.blur();
  相关解决方案