input上传文件显示文件名称在页面上

<!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>

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: