<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>上传文件显示文件名称在页面上</title>
</head>
<body>
<script type="text/javascript">
function show(){
document.getElementById("des").value = document.getElementById("f").value;
}
</script>
<input type="file" id="f" onchange="show()"/>
<input type="text" id="des"/>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>上传文件显示文件名称在页面上</title>
</head>
<body>
<script type="text/javascript">
function show(){
document.getElementById("des").value = document.getElementById("f").value;
}
</script>
<input type="file" id="f" onchange="show()"/>
<input type="text" id="des"/>
</body>
</html>