amiadogroup/candy — comment on commit dedaff295091bc0abfa7588a4e61103744dd6d35
File:  line 0
By dragonsblaze:

HTML5 input autofocus might be a good addition here, and even better if focus() is only used for fallback.

if (!("autofocus" in document.createElement("input"))) {
$('input').filter("[autofocus]")[0].focus();
}