Forum Moderators: open
I'm using javascript to insert chunks of html into parts of my page. However, wen the function is fired, the page scrolls to the top (or near the top), so the user has to scroll back down to see their data.
I'm basically doing a
div.innerHTML="<div>...blah ... blah...</div>";
Any idea why this is making the browser scroll?
Thanks!
The only other thing that comes to mind for me immediately is focus - if you have an element you add to the div that contains a focusable element - and you shift focus there - you would get a scroll effect.