uomads
08-05-2009, 04:37 PM
I'm trying to write a code which stimulated the function of TAB key. This is the code I wrote so far.
$('#scrollPane').keydown(function(event){
var key = event.charCode ? event.charCode : event.keyCode;
if(key==9){
// i need to get the next element focused by TAB key
return false;
}
});
What I need to do was obtaining the next element which will be focused, and focusing it manually. I tried using event.target, but it contains the currently focused element. So my code just focuses to the same place without moving to the next element. Can anybody help me out of here
$('#scrollPane').keydown(function(event){
var key = event.charCode ? event.charCode : event.keyCode;
if(key==9){
// i need to get the next element focused by TAB key
return false;
}
});
What I need to do was obtaining the next element which will be focused, and focusing it manually. I tried using event.target, but it contains the currently focused element. So my code just focuses to the same place without moving to the next element. Can anybody help me out of here