176
rated 0 times
[
180]
[
4]
/ answers: 1 / hits: 20307
/ 13 Years ago, thu, march 15, 2012, 12:00:00
I am trying to create a dynamic bar in HTML using javascript.
I have create the button but cannot seem to pass the value over to the progress bar.
Can someone please help me? thanks!
<button onclick=increase()>Add</button>
<button onclick=decrease()>Minus</button>
<input type=text id=tb>
<script type=text/javascript>
var value = 0 document.getElementById(tb).value = value;
function increase(){
this.value = value + 1; document.getElementById(tb).value=value;
}
function decrease(){
this.value = value - 1; document.getElementById(tb).value=value;
}
document.write(<div class='meter'><span style='width: 30%'></span> </div>);
document.write(<input type='text' id=tb>+value + </input>);
</script>
More From » html