Looping TabIndices

by amindunited

HTML

<form name="fooForm">
    <input id="i_1" name="i_1" tabindex="1"/>
    <input name="i_2" tabindex="2"/>
    <input name="i_3" tabindex="3"/>
    <input name="i_4" tabindex="4"/>
    <input name="i_5" tabindex="5"/>
    
    <span id="i_6" name="i_6" tabindex="6"></span>
</form>

CSS

#i_6 {
    
}

JavaScript

$(function(){
    $('#i_6').on('focus', function(){
        $('#i_1').focus();
    })    
})