Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTML | DOM Ol start Property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The DOM Ol start property is used to set or return the value of the start attribute in an ordered list. The start attribute in HTML is used to specify the start value for numbering the individual list item. It is used with an ordered list.

Syntax:

  1. It is used to return the start property.
    olObject.start
  2. It is used to Set the start property.
    olObject.start = number
  3. Property Values

    • number: It defines a start value which represent the start value of the first list item in the ordered list.

    Return Value: It returns a numeric value which represent the first value of the first list item in the ordered list.
    Example-1: HTML Program that illustrate how to return the property.




    <!DOCTYPE html> 
    <html
        <head
            <title>DOM ol start Property</title></title
        </head
        <body
            <h1 style="color:green;">
                GeeksForGeeks
               </h1
            <h2 style = "color: green;"
                DOM ol start Property 
            </h2
              
            <p>Sorting Algorithms</p
              
            <ol start="7" id="GFG"
                <li>Bubble sort</li
                <li>Merge sort</li
                <li>Quick sort</li
            </ol
          <button onclick="myGeeks()">Submit</button>    
          <p id="sudo" style="font-size:25px;color:green;">
          </p>
      
          <!-- Script to get the value of start property -->
          <script>
          function myGeeks()  {
          var x = document.getElementById("GFG").start; 
          document.getElementById("sudo").innerHTML = x;
          }
          </script>
        </body
    </html

    
    

    Output :
    Before clicking on the button:

    After clicking on the button :

    Example-2 : HTML Program that illustrate how to set the Property.




    DOM ol start Property

    GeeksForGeeks

    DOM ol start Property

    Sorting Algorithms

    1. Bubble sort
    2. Merge sort
    3. Quick sort




    Output:
    Before clicking on the button:

    After clicking on the button:

    Supported Browsers: The browser supported by DOM ol start Property are listed below:

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

    My Personal Notes arrow_drop_up
Last Updated : 21 Mar, 2022
Like Article
Save Article
Similar Reads
Related Tutorials