The below code snippet explains how to find the HTML control or element that currently has focus using jQuery
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
     <script type = "text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        var focusControl;
        $("input, select, textarea").live("focus", function () {
            focusControl = $(this);
        });
        $("#btnDemo").live("click", function () {
            if (focusControl.length > 0) {
                alert("Id: " + focusControl.attr("id") + " TagName: " + focusControl[0].tagName);
            } else {
                alert("No control has focus");
            }
        });
    </script>
</head>
<body>
    <form id="form1">
        <input type = "text" id = "text1" />
        <textarea id = "textarea1" rows = "1" cols = "1"></textarea>
        <select id = "dropdown">
        <option>a</option>
        <option>b</option>
        </select>
        <input id = "btnDemo" type = "button" value = "Get Focus Control" />
    </form>
</body>
</html>
 
Explanation:
Above I have a declared a variable focusControl which is initialized when focus occurs on any of these controls (input, select, textarea). Then when the demo button is clicked it displays the ID and the tagName attribute of the HTML control or element that currently has focus.