# model/autofocus

Source: https://zotonic.com/cotonic/models/autofocus

URI: https://zotonic.com/id/2739

Language: en



<a name="model.autofocus"></a>
The autofocus model looks for elements with the <tt>autofocus</tt> attribute which are just added to the dom tree. When this happens, it auto focusus them. The reason for this is is that the <tt>autofocus</tt> attribute only works during document render stage, but it is very handy to have available all the time.
<a name="model.autofocus.event.focus.key"></a>
event/focus/+key
----------------

The element with <tt>key</tt> has just been focussed.
<!-- serviceWorker model -->

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2739?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2739?language=en>)
