Since upgrading to the latest Chrome version 34.0.1847.116, the focus event does not seem to be firing when calling
myinput.focus()
in Javascript.
This works fine in Chrome 33.0.1750.154.
test.html
<html>
<head><title>Test</title></head>
<body>
<input id="test_box" onfocus="alert('focused');" />
</body>
</html>
From the console:
document.getElementById('test_box').focus();
No alert in Chrome 34.
Any ideas? Is this a bug? Is there a workaround to fire the event?
alertfor my test case (source) becausealertmucks about with focus. Tested with Chrome 34.0.1847.116 on Windows, I saw both the message saying I was about to focus, and the message from theonfocusattribute. - T.J. Crowder