Here, im going to show you how to set focus on Div element. to set focus on DIV id its required to DIV element has tabindex property with -1 value. without tabindex property below code never move your cursor focus to that DIV element.
<div id="mydiv" tabindex="-1"> </div>
jQuery for move focus