【发布时间】:2017-03-06 09:54:59
【问题描述】:
你好,我开发了一个表单,我通过单击添加新按钮来克隆一个 div。这个 div 有一个输入框和一个表格。当我单击 AddNew 按钮时,将创建一个新 div,它是第一个 div 的克隆,但我的问题相同,无法在这些 div 的输入框中输入。我无法实现此验证。
$("#insert17").click(function(){
$(".copyFromHere:first").clone().appendTo(".individualMarksSection")
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<div class="portlet light portlet-fit box individual individualDepartmentSection">
<input type="button" class="btn green individual" value="Add New+" id="insert17"></input>
<div class="copyFromHere portlet-body individual individualDepartmentSectionSub">
<label class="label1 col-md-12 individual labelDepartmentName"> Enter Department Name </label>
<input type="text" class="form-control individual DepartmentName"></input>
<table id="tableboth" class="arrSubjects table table-striped table-hover individual">
<thead>
<th>Employee</th>
<th>Salary</th>
</thead>
<tbody>
<tr>
<td>
<input type="text" class="form-control EmpName" disabled="true" name="EmpName">
</td>
<td>
<input type="text" class="form-control salary allownumericwithoutdecimal" maxlength="3" name="salary">
</td>
</tr>
</tbody>
</table>
</div>
</div>
【问题讨论】:
标签: javascript jquery html css input