最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Javascript .files[0] attribute in jQuery - Stack Overflow

programmeradmin5浏览0评论

Is there an equivalent to this statement in jQuery?

var value = document.getElementById(id).files[0];

Using the standard jQuery selectors with .files[0] appended doesn't appear to work, and I can't find an equivalent jQuery mand to .files. Any suggestions?

I'm using this to retrieve the file from an input type='file' form element.

Is there an equivalent to this statement in jQuery?

var value = document.getElementById(id).files[0];

Using the standard jQuery selectors with .files[0] appended doesn't appear to work, and I can't find an equivalent jQuery mand to .files. Any suggestions?

I'm using this to retrieve the file from an input type='file' form element.

Share Improve this question asked Jul 12, 2012 at 1:27 bentobento 5,0268 gold badges43 silver badges60 bronze badges 1
  • I am afraid there isn't for now. Please see this post. – Hausen Zheng Commented Jul 12, 2012 at 1:34
Add a ment  | 

1 Answer 1

Reset to default 13
$('#id').get(0).files[0]

get(0) return DOM element

发布评论

评论列表(0)

  1. 暂无评论