Question: I have a textbox on which I want to execute onBlur event only when tab key is pressed to remove focus from textbox.

How can I do this through javascript?

Any help is appreciated..

Answer: 
```
`enter code here`

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#theDiv input").bind("blur", function () {
            setTimeout(function () {
                var isOut = true;
                $("#theDiv input").each(function () {
                    if (this == document.activeElement) isOut = false;
                });
                if (isOut) {
                    // YOUR CODE HERE
                    alert("I am called");
                }
            }, 10);
        });
    });
</script>
<!-- ... -->
<div id="theDiv">
    <input type="text" value="Inside DIV 1" />
    <input type="text" value="Inside DIV 2" />
    <input type="text" value="Inside DIV 3" />
</div>
<input type="text" value="Outside DIV" />

```
```
<script type="text/javascript">

function callfunc() {
 alert("Hello");
}

</script>

<form>
  <input type="text" onblur="callfunc();">
</form>

```