1. 程式人生 > 其它 >type=file檔案上傳

type=file檔案上傳

技術標籤:CSS

效果:
在這裡插入圖片描述

js

  $('.choose-file').change(function (e) {
        $(this).parent().children('a').text(e.currentTarget.files[0].name)

html

  <div class="upload-file">
      <a>選擇檔案 </a>
      <input type="file" class="choose-file"></input>
</div>