1
当我单击减号按钮时,我希望文本框内的值减少,当我单击加号按钮时,我希望文本框内的值增加。我正在使用JSON模板来自动填充JSON。需要帮助将事件绑定到jQuery模板
<script id="template" type="text/x-jquery-tmpl">
<div style="display:block;" id="${getNextId()}">
<div class="adjuster">
<button id='minusbutton'>-</button>
<input id='quantityText' class="enterQuantity" type=text
style="width:40px; margin-left:5px;margin-right:5px" />
<button id='plusbutton'>+</buton>
</div>
<div class="productName">
<div>${productname}</div>
</div>
<div class="quantity">
<span style="font-weight:bold;">${quantity}</span>
<span> Remaining</span>
</div>
</div>
</script>
如果我在标记中的按钮上添加onclick事件,我该如何实现我的目标?
文本输入实现:[jsFiddle](http://jsfiddle.net/GAfyW/2/) – aztechy 2012-04-13 21:01:16