I have done the following code in JavaScript to put focus on the particular element (branch1 is a element),
document.location.href=\"#branch1\";
For my problem this code worked, I had to navigate to an anchor tag on page load :
$(window).scrollTop($('a#captchaAnchor').position().top);
For that matter you can use this on any element, not just an anchor tag.