如何使用jQuery更改为Bootstrap中的文件名更改。
我试图将上传文件中选择的文件设置为文件名。如何将未选择的文件设置为文件名。 我尝试过的是:
<input class="form-control" id="imgInp" type="file" accept=".png,.jpg,.jpeg" name="img" required>
在表单的负载下,我试图将选择的文件的值设置为文件名
$('#imgInp').val('abcd.jpg');
如何更改文件输入中不选择文件?
I am trying to set no file chosen in upload file to a filename . How to set no file chosen to a file name.
What I have tried is:
<input class="form-control" id="imgInp" type="file" accept=".png,.jpg,.jpeg" name="img" required>
On load of a form , I am trying to set value of no file chosen to a filename
$('#imgInp').val('abcd.jpg');
How to change no file chosen in file input?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单解决方案:
添加占位符
Easy Solution:
Add placeholder