HTML | DOM Progress position Property

The Progress position Property in HTML DOM is used to return the current position of the progress bar. The value of this property is the result of dividing the current value (specified with the value attribute) by the maximum value (specifies with the max attribute).

Syntax:

progressObject.position 

Return value: It returns a floating point number representing the current position of the progress bar.



Below example illustrates the progress position property in HTML DOM:

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
  
<head
    <title
        HTML DOM Progress position Property 
    </title
</head
      
<body
    <h1 style="color:green;"
        GeeksforGeeks 
    </h1
          
    <h2>
        DOM Progress position Property
    </h2
          
    Downloading progress for a song: 
    <progress id = "GFG" value = "57"
                max = "100"
    </progress
          
    <br><br
          
    <button onclick = "myGeeks()"
        Submit 
    </button
          
    <p id = "sudo"></p
          
    <script
        function myGeeks() { 
            var pr = document.getElementById(
                            "GFG").position; 
              
            document.getElementById("sudo")
                            .innerHTML = pr; 
        
    </script
</body
  
</html>

chevron_right


Output:

Supported Browsers: The browsers supported by HTML DOM progress position property are listed below:

  • Google Chrome
  • Internet Explorer 10.0
  • Firefox
  • Safari 6.0
  • Opera

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.