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