首页 > Web开发 > 详细

上传文件(单文件)(前端代码)

时间:2016-06-14 11:53:36      阅读:344      评论:0      收藏:0      [点我收藏+]

由于样式需要不能直接用file,只能用文本框+按钮

<input type="file" id="filepath" style="display:none" onchange="changetext()" />
<input type="text" id="txtpath" class="m-wrap" value="" />
<input class="btn green" type="button" value="选择文件" id="uploadpath" />

 

jQuery(document).ready(function () {
  $("uploadpath").click("click", function () {
    $("#filepath").trigger("click");
  });
})
function changetext()
{
  $("#txtpath").val($("#filepath").val());
}

上传文件(单文件)(前端代码)

原文:http://www.cnblogs.com/jianghaidong/p/5583204.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!