弹出选择文件对话框

参考文档:https://zhidao.baidu.com/question/455326094294267885.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>
<script type="text/javascript">
function F_Open_dialog()
{
document.getElementById("btn_file").click();
}
</script>
</head>
<body>
<div>
<!--<input type="file" id="btn_file" style="display:none">-->
<input type="file" id="btn_file" name="btn_file" value="">
<button type="button" onclick="F_Open_dialog()">选择文件</button>
</div>
</body>
</html>

posted @ 2017-07-26 09:52  个子  阅读(521)  评论(0)    收藏  举报