I have a page with multiple tabs and i Show and hide them based on a href click using jquery. Whenever I click on “a href”, the page is scrolled down. Am trying to set the focus on the top of the page. This is my first project in Jquery. I tried the following but still doesnt work.
- scroll(0, 0);
- window.scrollTo(0,0);
- window.scrollTo(0, document.body.scrollHeight);
- var ctrl = document.getElementById(‘lnkCreateJob’);
ctrl.focus();
please do share some light on that matter.
Try like this:
SEE DEMO