So, here is a script that changes focus.
var focused;
$('input').focus(function() {
focused = $(this);
});
$(document).keydown(function(e) {
e.preventDefault();
if (e.keyCode == 40) {
if ( $(focused).parent().hasClass("reso") ) {
$(focused).parent().prev().find("input").focus();
} else {
$(focused).parent().next().find("input").focus();
}
}
});
As you can see, you should get an object like this (this is the part where I specified the targeted input that you see?):
var focused;
$('input').focus(function() {
focused = $(this);
});
, jsFiddle. , , , . , , . , , , . , , .