Open In App

HTML DOM Marquee scrollamount Property

Last Updated : 15 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML DOM Marquee scrollamount Property is used to set or return the value of the scrollamount attribute of the <marquee> element. The scroll amount attribute is used to set the amount of scrolling at each interval in pixels. The default speed of the marquee value is 6.

Syntax:

It returns the marquee scrollamount property.

marqueeObject.scrollAmount;

It sets the marquee scrollamount property.

marqueeObject.scrollAmount="number" 

Note: This property is depreciated from HTML 5.

Property Values: It contains a numeric value that represents the speed value of the scrolling element. 

Example: Below HTML code use to returns the Marquee scrollamount Property. 

HTML




<!DOCTYPE html>
<html>
 
<body style="text-align:center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
 
    <h2>DOM Marquee scrollAmount Property</h2>
 
    <marquee id="marqueeID" direction="right" behavior="slide"
             loop="30" bgcolor="green" height="40px"
             Scrollamount="12">
        GeeksforGeeks:A computer Science
        Portal for Geeks
    </marquee>
    <br><br>
 
    <button onclick="btnClick()">
        Return speed of Marquee Tag
    </button>
    <p id="sudo"></p>
 
 
 
    <script>
        function btnClick() {
            var txt = document.getElementById(
                "marqueeID").scrollAmount;
 
            document.getElementById(
                "sudo").innerHTML = txt;
        }
    </script>
</body>
 
</html>


Output:

HTML DOM Marquee scrollamount Property

HTML DOM Marquee scrollamount Property

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads