JQuery-plugin-autofocusBackspace is a project mainly written in JavaScript, it's free.
jQuery plugin that focuses the first of the matching elements while preserving the backspace functionality of navigating to the previous page.
Plugin mimics browser backspace behaviour until:
Example:
$('input').autofocusBackspace();