且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将新行添加到包含单击按钮的下拉列表的表中

更新时间:2023-12-01 08:47:19

如果您具有会话属性类型",那么您可以这样做.发布您剩余的编码,以便我更新我的答案.

If u have session attribute "types" then u can do like this. Post ur remaining coding so i can update my answer.

var Type = 'option 1';

function AddRow() {
    $('#tblTest').append(
        '<tr><td>' +
          '<input type="text" />' +
          '<select><option>' + Type + '</option></select>' +
        '</td></tr>');
}

<table id="tblTest">
    <tr>
        <td>
            <input type="text" name="data1" value="TempData" />
        </td>
        <td>
            <input type="button" value="Add" onclick="AddRow()" />
        </td>
    </tr>
</table>