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
2010-08-20 14:06:41
just going to note this is correct for standards compliant browsers, but not IE.
lincolnk
2010-08-20 15:04:15
Logic should be separate from structure and content, therefore using the traditional attribute way of binding events is not clean.
Delan Azabani
2010-08-20 14:09:00
actually whatever uses less code and still has no errors is always better Delan...
David
2010-08-20 16:31:35