0
我想在使用javascript的HTML中创建一个动态栏。 我已经创建了按钮,但似乎无法将值传递给进度条。 有人可以帮我吗?谢谢!动态进度条Javascript和HTML
<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>
<按钮的onclick = “增加()”>添加 <按钮的onclick = “降低()” >减号 \t \t <脚本类型= “文本/ JavaScript的”> \t \t \t VAR值= 0 \t \t \t的document.getElementById( “TB”)值=值。 \t \t \t \t \t \t函数增大(){ \t \t \t THIS.VALUE =值+ 1; \t \t \t document.getElementById(“tb”)。value = value; \t \t \t \t} \t \t \t \t \t \t功能减退(){ \t \t \t THIS.VALUE =值 - 1; \t \t \t document.getElementById(“tb”)。value = value; \t \t \t} \t \t \t \t \t \t文件撰写( “
http://jsfiddle.net/(有代码) – Alp 2012-03-15 20:19:09
你可以给我们提供一些代码吗? – 2012-03-15 20:19:27