<div class="codetitle"> <span><a style="CURSOR: pointer" data="6895" class="copybut" id="copybut6895" onclick="doCopy('code6895')"><u>复aze代码</u></a></span> 代码如下:</div> <div class="codebody" id="code6895"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 전환//EN" "http://www.w3.org/TR/html4/loose.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><html> <br><머리> <br><title>添加附件</title> <br></head> <br><script type="text/javascript" src="jquery-1.8.0.js"></script> <br><script type="text/javascript"> <br>함수 fclick(obj){ <br>style.posTop=event.srcElement.offsetTop <br>style.posLeft=event.x-offsetWidth/2 <br>} <br>$(function(){ <br>$("#addFile").click(function(){ <br>var br = $("<br>"); <br>var input1 = $("<input id='inputrecievedocument' type= 'text'/>"); <br>var input2 = $("<input type='button' style='margin-left:5px;Background-color:blue' id='btnrecievedocument' onmouseover='fclick (t_file)' value='浏览'/>"); <br>var input3 = $("<input name='upfile' type='file' style='position:absolute;filter:alpha(opacity= 0);너비:70px;' id='t_file' onchange='inputrecievedocument.value=this.value' hidefocus/>"); <br>var 버튼 = $("<입력 유형='버튼' value= '删除' style='margin-left:5px; background-color:blue'/>"); <br>$("#file").append(br).append(input1).append(input3). 추가(입력2).append(버튼); <br>button.click(function() { <br>br.remove(); <br>input1.remove(); <br>input2.remove(); <br>input3.remove(); <br>button.remove(); <br>}) <br><br>}); <br></script> <br><body class="body"> <br><form method="post" action="" enctype="multipart/form-data"> <br><input type="button" value="添加附件" class="btn_fujian" id="addFile" style="margin-left:20px;margin-top:2px;"/> <br><div id="file"></div> <br></form> <br></body> <br></html> <br><br> <br>IE9中运行如下: </div> <br>