linuxs

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

  •  
  •   linuxs · Nov 13, 2017 · 2676 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   ·   3192 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 13:52 · PVG 21:52 · LAX 06:52 · JFK 09:52
    ♥ Do have faith in what you're doing.