点击more按钮添加一个文件域、remove按钮
点击remove按钮移除对应的文件与和remove按钮
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="../jquery-3.2.1/jquery-3.2.1.js"></script> <script type="text/javascript"> $(function(){ $("#btn1").click(function(){ var file = $("<input type = 'file' />"); var button = $("<input type = 'button' value = 'remove' />"); var br = $("<br/>"); button.click(function(){ file.remove(); button.remove(); br.remove(); }); $("#div1").append(file); $("#div1").append(button); $("#div1").append(br); }); }); </script> </head> <body> <div id="div1"> <input type="file" /> <input type="button" name="btn1" id="btn1" value="more" /> <br /> </div> </body> </html>