110,547
社区成员
发帖
与我相关
我的任务
分享
//新增加一栏
$(function () { // 相当于在页面中的body标签加上onload事件
$(".addTextBox").click(function () {
var input = $("<td><input type='text' value=' /></td>"); // 文本框1的HTML代码
var input2 = $("<td><input type='text' value='100' /></td>"); // 文本框2的HTML代码
$(".textboxCpxh1").html(input);
$(".textboxCpsl1").html(input2);
})
})
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页 </title>
<%-- <script>
var i = 0;
function setDiv() {
var Ddiv = document.getElementById("divInfo ");
Ddiv.innerHTML += ' <input type= "text" name= "txt_" '+ i + 'id= "txt_ " ' + i + ' value= ' + i + ' /> '
i++;
}
</script> --%>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/AddPro.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="1px" style="bgcolor: #e4e4e4">
<tr>
<td>
</td>
<td>
<a href="#"><span class="addTextBox">增加一栏</span></a>
</td>
<td>
</td>
</tr>
<tr>
<td>
1
</td>
<td>
型号
</td>
<td>
数量
</td>
</tr>
<tr>
<td>
1
</td>
<td>
<asp:TextBox ID="textboxCpxh" runat="server" Width="200px"></asp:TextBox>
</td>
<td>
<asp:TextBox ID="textboxCpsl" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td class="textboxCpxh1">
</td>
<td class="textboxCpsl1">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>