Create a Meter Element - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Meter


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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">create a METER element with a specified value</button>

function myFunction() {/*from   ww  w.  j a va2s  .  c o  m*/
    var x = document.createElement("METER");
    x.setAttribute("min", "0");
    x.setAttribute("max", "100");
    x.setAttribute("value", "65");

Related Tutorials