<button type="button" class="all btn btn-xs btn-danger">get all</button>
<br><br>
<tr class="item">
<td style="text-align: right; padding: 5px 15px 2px 0; ">5000</td>
<td style="padding: 3px 0 0 0;"><button type="button" class="get btn btn-xs btn-danger">get</button></td>
<td style="padding: 2px 0 2px 0; "><input id="mc" name="name['1']" data-max="5000" class="sell">
</td>
</tr>
<br><br>
<tr class="item">
<td style="text-align: right; padding: 5px 15px 2px 0; ">1000</td>
<td style="padding: 3px 0 0 0;"><button type="button" class="get btn btn-xs btn-danger">get</button></td>
<td style="padding: 2px 0 2px 0; "><input id="mc" name="name['2']" data-max="1000" class="sell">
</td>
</tr>
<br><br>
<tr class="item">
<td style="text-align: right; padding: 5px 15px 2px 0; ">8000</td>
<td style="padding: 3px 0 0 0;"><button type="button" class="get btn btn-xs btn-danger">get</button></td>
<td style="padding: 2px 0 2px 0; "><input id="mc" name="name['3']" data-max="8000" class="sell">
</td>
</tr>
$(document).ready(function(){
$('.buto').click(function(){
var value = $("#mc").attr('data-max');
$("#mc").val(value);
});
});
如何從數據最大價值=(在這裏)後點擊按鈕(類GET)如何自動點擊按鈕後,插入VAL
和1個鍵插入從數據-MAX所有VAL插入量(類全部)
有帶班'buto'沒有按鈕它應該是'btn'? – MaxZoom 2015-04-03 19:59:58
還建議不要使用相同的值的ID – MaxZoom 2015-04-03 20:15:41