javascript scroll to page area [SOLVED]
Posted: Sun Sep 16, 2007 8:51 pm
I have a page loading that I give focus to a textarea. Sometimes the textarea isn't always above the "fold" of the page, in which case I want the page to scroll down a little bit to show the textarea.
Both of those obviously don't work. How would I go about doing this?
Code: Select all
document.getElementById('txtForm').scrollIntoView(true);
document.getElementByTagName('body').scrollBy(0, 500000);