Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Home Javascript JavaScript method doScroll()

Related Tutorials


Share on Google+Share on Google+

JavaScript method doScroll()

This section illustrates you the use of JavaScript method doScroll().

JavaScript method doScroll()


This section illustrates you the use of JavaScript method doScroll(). This method simulates a user action on a scroll bar component. In the given example we have created a text area in order to scroll it by using the method doScroll(). Its syntax is:

document.all.elementID.doScroll(p) where p is the scrolling action.




Here is the code:

<h2>Use of method doScroll()</h2>
<script language="JavaScript">
function scrollDown ( ) {
s.doScroll ( "scrollbarDown" );
function scrollUp(){
s.doScroll ( "scrollbarUp" );
<button onclick="scrollDown()">Scroll Down</button>
<button onclick="scrollUp()">Scroll Up</button>
<textarea id="s">Hello World, Happiness cannot be traveled to, owned, earned, worn or consumed. Happiness is the spiritual experience of living every minute with grace and gratitude.</textarea>

Output will be displayed as:

Download Source Code:



If you enjoyed this post then why not add us on Google+? Add us to your Circles

Liked it!  Share this Tutorial

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 20, 2005

Related Tutorials

Discuss: JavaScript method doScroll()  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image