代言2017-07-05 10:51:31
亲,这个好办,你绑定p click事件,再click 隐藏的input[file]的输入框!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<script>
function showResurce() {
document.getElementById('resurce').click();
}
</script>
</head>
<body>
<p onclick="showResurce()">点我</p>
<input id="resurce" type="file" style="display: none">
</body>
</html>