Javascript examples for DOM HTML Element:Paragraph
make a progress bar with <p> element
<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>