javascript - Checkbox to button focus -
i've got multiple forms on page. in 1 form i've got 3 text fields check box , button. when tab key pressed, goes 3 text fields , checkbox , no where. how can focus button ( submit ) after checkbox ( maths ) , first text field ( user_id ). <form id="form13"> user id :<input type="text" id="user_id" /><br> password: <input type="password" id="password" /><br> department: <input type="text" id="department" /><br> <input type="checkbox" id="maths" value="on"> maths <input type="submit" id="submit" value="submit" /> </form> $('#maths').keydown(function(e){ if (e.which == 9){ $('#submit).focus(); } }); if need handle tabbing in html forms. may need handle html attribute tabindex article learning purpose : <input id="