• jquery 元素前或插入一元素


    /*
    *插入方法
    */
    function addEditRow(obj, modelId) {

    $($("#" + modelId).html()).insertAfter($(obj).parent().parent().parent())

    }

    触发按钮

    <input type="button" onclick="addEditRow(this,'trModelLearn')"  class="addJ" value="+">

    插入内容

    <table id="trModelLearn" style="display: none;">
    <tr class="datarow">
    <input type="hidden" class="leamid" value="">
    <td><label><input class="form-control layer-date dates startstopdate" placeholder="开始时间" dataRequire="true" errorMessage="请选择时间!" onclick="laydate({ format: 'YYYY-MM-DD'})" />-<input class="form-control layer-date dates enddate" placeholder="结束时间" dataRequire="true" errorMessage="请选择时间!" onclick="laydate({ format: 'YYYY-MM-DD'})" /></label></td>
    <td><label><input class="schoolname" type="text" dataRequire="true" errorMessage="不能为空!"/></label></td>
    <td><label><input class="speciality" type="text" dataRequire="true" errorMessage="不能为空!"/></label></td>
    <td><label><input class="record" type="text" dataRequire="true"/></label></td>
    <td><label><input class="remark" type="text" /></label></td>
    <td><input type="button" onclick="addEditRow(this,'trModelLearn')" class="addJ" value="+">
    <input type="button" onclick="delEditRow(this)" class="addJ" value="-">
    </td>

    </tr>
    </table>

  • 相关阅读:
    SCUT
    SCUT
    SCUT
    ???
    Codeforces
    SCUT
    SCUT
    SCUT
    SCUT
    2019牛客暑期多校训练营(第八场)
  • 原文地址:https://www.cnblogs.com/niuxi/p/7246569.html
Copyright © 2020-2023  润新知