The blur() method makes the element lose keyboard focus.
blur()
To make the currently active element lose keyboard focus, run
document.activeElement.blur();