Use JS to get the ID with focus control:
Copy code code as follows:
$ ("#Textid"). CLICK (Function () {
var act = document.activeElement.id;
if (ACT == "Textid") {
alert ("true");
} Else {
alert ("false");
}
});
Use jQuery to obtain IDs with focus control: var act = $ (document.activeElement) .attr ("ID");
----------------------<input type="text" id="textID">