hjbky

html:

<div>
    <input id="lefile" type="file" style="display:none">
    <input id="photoCover" type="text">
    <a class="btn-up">点击上传文件</a>
</div>

js:

$(\'.btn-up\').on(\'click\',function () {
            $(\'input[id=lefile]\').click();
        })
        $(\'input[id=lefile]\').change(function() {
            $(this).next(\'input\').val($(this).val().split(\'\\\').pop());
        });

 

分类:

技术点:

相关文章:

  • 2022-02-07
  • 2021-09-09
  • 2021-06-10
  • 2021-12-27
  • 2021-12-27
  • 2021-11-14
  • 2021-12-26
  • 2021-10-02
猜你喜欢
  • 2021-12-27
  • 2021-12-27
  • 2021-12-27
  • 2022-12-23
  • 2021-06-01
  • 2021-12-27
  • 2021-12-12
相关资源
相似解决方案