我是 jQuery 的新手,无法完全理解它。我只是从我的 php 文件中复制了这段代码并将其放在那里。这是我在 php 中的代码: <div class="form-row" id="dynamic_field"> <div class="input-group"> <input type="text" class="form-control" name="lname" placeholder ="Last Name" required> <input type="text" class="form-control" name="fname" placeholder ="First Name" required> <input type="text" class="form-control" name="mname" placeholder ="Middle Name"> <select class="form-control" name="gender" required> <option value="">Gender</option> <option value="Male">Male</option> <option value="Female">Female</option> </select> <br> Semester Started: <select class="form-control" name="semenrolled1" required> <option>Select Semester</option> <?php $query5 = "select distinct(term_name) from term"; $rsf5 = mysql_query($query5); while($row5 = mysql_fetch_array($rsf5)){ ?> <option> <?php if($row5['term_name']!=' '){ echo $row5['term_name']; } ?> </option> <?php } ?>这是我的动态输入字段代码: $(document).ready(function(){ var i = 1; $('#dynamic_add').click(function(){ i++; }); $(document).on('click','.btn_remove', function(){ var button_id = $(this).attr("id"); $("#row"+button_id+"").remove(); }); });错误显示“解析错误”,我不知道该怎么办。
1 回答
- 1 回答
- 0 关注
- 144 浏览
添加回答
举报
0/150
提交
取消