首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-03-13 
让文本框获得焦点的方法是txt1.focus(),那失去焦点的方法是什么?rt[解决办法]blur[解决办法]onblur 在对象

让文本框获得焦点的方法是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();

热点排行