Is it possible to programmatically change the value of the document.activeElement property in JavaScript?
document.activeElement
You can just .focus() the element you want and it'll be the new document.activeElement.