English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
focus()The method assigns focus to an element.
Usageblur()The method removes focus from an element.
HTMLElement.focus()
document.getElementById('myText').focus();Test and See‹/›
All browsers fully support the focus() method:
Method | |||||
focus() | Yes | Yes | Yes | Yes | Yes |
Return Value: | None |
---|
HTML DOM Reference:blur() method