DOM Methods
HTMLElement.blur()
Removes focus from the element if it currently has it. This is not a reliable way to move focus to a specific next target. Use a meaningful focus destination instead of suppressing focus indicators. Example result: false.
Formal Syntax & Structure
html syntaxhtml
element.blur()Return Value
undefined
No return value.
Working Example
Example Snippethtml
<input id="demo"><p> Result: <output id="result"></output></p><script> const e = document.getElementById('demo'); const result = value => { document.getElementById("result").textContent = String(value); }; e.focus(); e.blur(); result(document.activeElement===e);</script>