作者热门文章
- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
我想在我网页的链接上有一个Open File
对话框。
我试过了
<input name="uploadedfile" type="file">
但是,它用作按钮。并且,不允许选择多个文件。
我想要一个类似的东西
<a href="#" onclick="some_function_for_OpenFileDialogBox">Upload Files</a>
请提出建议。
谢谢
考尔
最佳答案
您只能使用 input type=file 标签打开“打开文件”对话框。然而,您正在寻找的效果可以这样实现:
<input type="file" id="upload" name="upload" style="visibility: hidden; width: 1px; height: 1px" multiple />
<a href="" onclick="document.getElementById('upload').click(); return false">Upload</a>
关于javascript - <a> 标签上的打开文件对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10216331/
我是一名优秀的程序员,十分优秀!