tags:

views:

54

answers:

2

How do you bring focus to a text field when you hover the mouse on top of the field?

+2  A: 
myInputField.addEventListener('mouseover', function(e) {
    e.target.focus();
}, false);
Delan Azabani
just going to note this is correct for standards compliant browsers, but not IE.
lincolnk
+4  A: 

without jquery..

<input type=text   ....   onMouseOver="this.focus();">
Fosco
Logic should be separate from structure and content, therefore using the traditional attribute way of binding events is not clean.
Delan Azabani
No offense, but all I heard was "blah blah blah."
Fosco
actually whatever uses less code and still has no errors is always better Delan...
David