首页 > 代码库 > file控件样式

file控件样式

<html>
<body>
<form method="post" name="f1">
<input type="text" name="predent" id="puf" />

<input type="button" value="http://www.mamicode.com/浏览..." onclick="mc()" />
<input type="file" name="uf" id="uploadfile" style="display:none" onchange="mm()" />
</form>
<body>
</html>
<script>
$=function(id){return document.getElementById(id);}
function mc(){var _i=$("uploadfile");_i.click();}
function mm(){$("puf").value=http://www.mamicode.com/(document.f1.uf.value);}
window.onload=function(){
}
</script>

file控件样式