« XUL Reference home
onfocus
Type: script code
This event is sent when a textbox receives keyboard focus.
Note: The behavior of this event has evolved over time. Prior to Gecko 1.9 (Firefox 3), the script code would execute in the context of the anonymous HTML <input> element inside the textbox binding. From Gecko 1.9 to Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9), the script code would actually execute twice, once in the context of the anonymous HTML <input> element and once in the context of the <textbox> element itself. As of Gecko 13.0 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10), the script code only runs in the context of the <textbox> element, matching the behavior of all other event handlers.