Question not written properly, but looks like you want to find the control in focus at a given time.
You can try either of these:
1. Use
document.activeElement
property in JS to know the currently focused element. Use it accordingly.
2. Use jQuery selector
:focus
, example:
var element = document.querySelector(":focus");