Avatar ·

How to determine which DOM element is in focus on a web page?

Hello everyone! I'm making a small text editor in pure JavaScript, and I need to track which input field the user is currently typing in. I have several ` ``` ```javascript // I want to get the element