title: How to detect focus changed event in JS?
body: <p>I want to write a function, this function can detect whether the focus is on the certain element.If the focus is on the element, I call the <code>onfocus()</code> function, and if not on the element, I do nothing.How can I do this?</p>