所以当页面加载时文本框中会包含一个存储值。我希望用户按下“+”按钮,文本框中的值将增加1。林猜测这是与jQuery做......在哪里开始任何想法,到目前为止,我...按下按钮并在文本框中增加值
<input type="text" name="BoqTextBox" id="BoqTextBox" value="0" />
<input type="Button" value="+" onclick="AddOne(document.getElementById('BoqTextBox').value)" />
<script>
function Add(data) {
//so the current digit is passed to here, where I need to do some funky code
//where it increments the current digit by one and stores it in BoqTextBox - replacing the old digit.
//Also to note if the text box contains 124.54 for example and + is pressed
//then new value will be 125.54
}
</script>
任何这帮助将是巨大的。
谢谢
...像数据=数据+ 1,但后来我怎么返回值到文本框?
函数调用是AddOne和你的函数是添加..你真的认为这将工作吗? – bipen 2013-03-22 17:57:16
是的,当我试图建立一个JSFiddle时,我发现了这个问题。应该是固定的:) – 2013-03-22 17:57:53
是的罚款现在... :)) – bipen 2013-03-22 17:59:12