JSは新しい要素グループを作成し、現在の要素グループを削除します.

1418 ワード


$(document).ready(function(){
  $("#add_guest").click(function(){
<span style="white-space:pre">	</span>  $("#YK").append("<li >  :<input name='plan_user_name[]' type='text' id='plan_user_name[]' size='9'>&nbsp;&nbsp;<select name='plan_user_sex[]' id='plan_user_sex[]'><option value='  '>—  —</option><option value=' '> </option><option value=' '> </option></select>&nbsp;&nbsp; <select name='plan_user_sort[]' id='plan_user_sort[]'><option value='  '>—    —</option><option value='   '>   </option><option value='   '>   </option><option value='  '>  </option><option value='   '>   </option><option value='     '>     </option><option value='  '>  </option></select>&nbsp; &nbsp;    :<input type='text' name='plan_user_haoma[]' id='plan_user_haoma[]'>&nbsp;&nbsp;  :<input name='plan_user_tel[]' type='text' id='plan_user_tel[]' size='13'>&nbsp;  :<input type='text' name='plan_user_beizhu[]' id='plan_user_beizhu[]' maxlength='20'><input type='button' name='del[]' id='del[]' value='  ' οnclick='dl(this.parentNode)'><BR></li>");
  });
 });
function dl(obj){
obj.parentNode.removeChild(obj);
}