Create a Progress Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Progress


You can create a <progress> element by using the document.createElement() method:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">create a PROGRESS element with a maximum value of "100" and a current value of "42"</button>

function myFunction() {//from  w ww .  ja va  2 s  .c om
    var x = document.createElement("PROGRESS");
    x.setAttribute("value", "42");
    x.setAttribute("max", "100");


Related Tutorials