欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JS實(shí)現(xiàn)點(diǎn)擊Radio動(dòng)態(tài)更新table數(shù)據(jù)

 更新時(shí)間:2017年07月18日 14:07:11   作者:intro  
這篇文章主要介紹了JS實(shí)現(xiàn)點(diǎn)擊Radio動(dòng)態(tài)更新table數(shù)據(jù)的相關(guān)資料,需要的朋友可以參考下

tbody定義一個(gè)標(biāo)簽

當(dāng)上面變化的,在js里面做拼接就行了,拼接結(jié)束 tbody.html(XXX)

<script type="text/javascript">
  $(function(){
  var quotas = {
    1:{name:"工商銀行",oneTime:1000},
    2:{name:"農(nóng)業(yè)銀行",oneTime:800},
    3:{name:"中國(guó)銀行",oneTime:2000},
    4:{name:"建設(shè)銀行",oneTime:10}};
 $(":radio").click(function(){
    console.info("click:"+$(this).val());
    var quota = quotas[$(this).val()];
    var quotaHtml = [];
    quotaHtml = quotaHtml.concat([
      '<tr>',
        '<td>'+quota.name+'</td>',
        '<td>'+quota.oneTime+'</td>',
        '<td>100</td>',
        '<td>100</td>',
        '<td>100</td>',
      '</td>'
    ])
    console.info("html:"+quotaHtml);
    $("#quota").html(quotaHtml)
  });
 });
</script>
<body>
  <input type="radio" name="bank" value="1"/>工商銀行
  <input type="radio" name="bank" value="2"/>農(nóng)業(yè)銀行
  <input type="radio" name="bank" value="3"/>中國(guó)銀行
  <input type="radio" name="bank" value="4"/>建設(shè)銀行
  <br/>
  <table>
    <tr>
      <th>銀行</th>
      <th>額度</th>
      <th>日額度</th>
      <th>月額度</th>
      <th>還有啥額度</th>
    </tr>
    <tbody id="quota"></tbody>
  </table>
</body>

以上所述是小編給大家介紹的JS實(shí)現(xiàn)點(diǎn)擊Radio動(dòng)態(tài)更新table數(shù)據(jù),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論