Hi folks,
I am facing an issue with this simple jQuery code.
I have attached the HTML structure as well,
The code is setting focus to the input field fine if I make a click anywhere on the div with id "scroll-pane", but if I click anywhere else in the screen, for example, code above the div id "scroll-pane", it doesnt bring the focus. what am I doing wrong here?
<script language="javascript">
$(function()
{
$('.scroll-pane').jScrollPane();
$('#outerBody').keydown(function() {
$('#serialCode').focus();
});
});
</script>
<center id="outerbody">
<table id="tab1" class="Tab1" width="100%">
<tr>
<td width="60"></td>
<td width="113"><p align="center">C</td>
<td width="105"> </td>
</tr>
</table>
<table id="tab2" class="Tab2" border="0" width="100%">
<tr>
<td> </td>
<td>A </td>
<td>B </td>
<td><input type="text" id="serialCode" class="serialCode" /></td>
</tr>
</table>
<div id="scroll-pane" class="scroll-pane">
</div>