I know input type=‘file’ can do it.
But I saw that some websites use p to bind an event, and I don’t know how to implement it.
代言2017-07-05 10:51:31
Dear, this is easy to do, you bind the p click event, and then click the hidden input[file] input box!
<!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>
为情所困2017-07-05 10:51:31
One solution is to have a hidden input file somewhere else and trigger it after clicking p.