Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Focus To First Input (greasemonkey)

DZone's Guide to

Focus To First Input (greasemonkey)

·
Free Resource
// kakšen kmet morš bit da ne daš fokusa na input


for (i=0; document.getElementsByTagName('input').length; i++) {
    if(document.getElementsByTagName[i].type == 'text') {
        document.getElementsByTagName[i].focus();
        exit;   
    }
}
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}