linuxs

jquery 如果把获取到的值,循环添加到 td 中?

  •  
  •   linuxs · Nov 13, 2017 · 2677 views
    This topic created in 3130 days ago, the information mentioned may be changed or developed.
    html:
    <tbody>
    <tr>
    <td id="myid"></td>
    <td id="myip"></td>
    </tr>
    </tbody>
    </table>
    ---------------------------------------------------------------------------------------------------
    jquery:

    function getall() {
    var ids=""
    var ips=""
    $("input[name='selected']").each(function(){
    if($(this).is(":checked")){
    var id=$(this).attr("id");
    ids=ids+id+","
    var ip=$("#netip" + id).html()
    ips=ips+ip+","
    }
    });

    $("#myid").html(ids);
    $("#myip").html(ips);
    }
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3137 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 15:03 · PVG 23:03 · LAX 08:03 · JFK 11:03
    ♥ Do have faith in what you're doing.