Say then that we want the myMeter div to be a power meter with a max value of 100 and a current value of 70. Our JavaScript would be:

new PowerMeter("myMeter", 70, 100);

To turn our div into a functioning meter that allows user manipulation, we do:

new PowerMeter.Control("myMeter", 70, 100);

PowerMeter supports numeric labels that reflect the current value of the meter. This is realized by passing another HTML element as the currentValueLabel option, and optionally various label parameters describing how the value label should be formated based on the value itself: