87,993
社区成员
发帖
与我相关
我的任务
分享
<input type=file name=x id=x style="display:none">
<input type="text" name="pa" id="pa">
<a href='' onclick="f()">上传</a>
<script type="text/javascript">
function f(){
document.getElementById('x').click();
document.getElementById('pa').value=document.getElementById('x').value;
return false;
}
</script>
<input type=file name=x id=x style="display:none">
<input type="text" name="pa" id="pa">
<a href='' onclick="document.getElementById('x').click();document.getElementById('pa').value=document.getElementById('x').value;return false;">上传 </a>
<style>
div.fileinputs {
position: relative;
overflow: hidden;
width: 70px;/* this width should be changed */
}
div.fakefile {
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}
input.file {
position: relative;
text-align: right;
left: -132px; /* this width should be changed */
*left: -152px; /* this width should be changed */
z-index: 2;
-moz-opacity:0;
filter:alpha(opacity: 0);
opacity: 0;
}
</style>
<div class="fileinputs">
<input type="file" class="file" />
<div class="fakefile">
<a href="" onclick="return false;">Click Me</>
</div>
</div>