语法 onFocus="handlerText" 参数
描述 The focus event can result from a focus method or from the user clicking the mouse on an object or window or tabbing with the keyboard. Selecting within a field results in a select event, not a focus event. onFocus executes JavaScript code when a focus event occurs. A frame's onFocus event handler overrides an onFocus event handler in the BODY tag of the document loaded into frame. Note that placing an alert in an onFocus event handler results in recurrent alerts: when you press OK to dismiss the alert, the underlying window gains focus again and produces another focus event. Note In Navigator 3.0, on some platforms, placing an onFocus event handler in a FRAMESET tag has no effect. 使用的事件属性
示例 The following example uses an onFocus handler in the valueField Textarea object to call the valueCheck function. <INPUT TYPE="textarea" VALUE="" NAME="valueField" onFocus="valueCheck()"> See also示例 for onBlur.
参看 onBlur, onChange
要获得关于事件句柄的常规信息,请看“事件的常规信息”。
要获得关于事件对象的信息,请看事件。
回页面顶部