无法获取输入类型的值=“文件”? [英] Can't get value of input type="file"?
问题描述
我有一个< input type =fileid =uploadPicturevalue =123>
当我使用时: alert($(#uploadPicture)。val());
它提醒一个空白的对话框。
你可以阅读它,但你不能设置<强>它。 value =123
将被忽略,所以直到您点击它并选择一个文件才会有值。
即使这样,该值可能会被像$ I have a When I'm using: It alerts an empty dialog. You can read it, but you can't set it. Even then, the value will likely be mangled with something like 这篇关于无法获取输入类型的值=“文件”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!<input type="file" id="uploadPicture" value="123">
alert($("#uploadPicture").val());
value="123"
will be ignored, so it won't have a value until you click on it and pick a file.c:\fakepath\
to keep the details of the user's filesystem private.