make a progress bar with <p> element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Paragraph

Description

make a progress bar with <p> element

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from  w  w w . j a v  a 2 s  .  c o m
var myElement = document.getElementById("progressbar");
var percentage = 25;
myElement.style.background = "linear-gradient(to right, #57c2c1 " + percentage + "%, #4a4a52 " + percentage + "%)";
    }

      </script> 
   </head> 
   <body> 
      <p id="progressbar">Loading...</p>  
   </body>
</html>

Related Tutorials