我试图在单击按钮时动态添加一个 div 字段,但我没有得到响应。这是我的代码。
<div id="#para">
<tr class="divider"></tr>
<tr>
<td><input type="text" placeholder="Enter Medicin Name" style="width:80%;height:30px;"></td>
<td><input type="file" </td>
<td><input type="time" placeholder="Enter Medicin Time"></td>
<td><input type="date" placeholder="Enter Start Date"></td>
<td><input type="date" placeholder="Enter End Date"></td>
</tr>
<tr class="divider"></tr>
</div>
<button type="submit" class="button" id="#btn1" value="Submit"><img src="images/plus.png"> Add More Notification</button>
这是我的 Js 代码
$(document).ready(function(){
$("#btn1").click(function(){
$("#para").append(' <tr class="divider"></tr> <tr class="notification-row"><td><input type="text" placeholder="Enter Medicin Name" style="width:80%;height:30px;"></td> <td><input type="file" </td> <td><input type="time" placeholder="Enter Medicin Time"></td> <td><input type="date" placeholder="Enter Start Date"></td><td><input type="date" placeholder="Enter End Date"></td> </tr><tr class="divider"></tr>');
});
});