JS determines that an object has received focus document.activeElement.tagName //tagName tag name
Example: Determine whether to close the input method when the body gets the cursor.
<script><br>function test(){<br>var srcElem = document.activeElement<br>var testval = srcElem.name; //id and name are more commonly used and should be <br>alert("control" testval "Get focus");<br>}<br></script>