我可以将HTML5下载属性用于HTML表单吗? [英] Can I use HTML5 download attribute for HTML forms?
问题描述
HTML5引入了一个很好的功能,只需将download
属性添加到<a>
标记
HTML5 introduced a nice feature for marking <a>
links as download endpoints, by simply adding download
attribute to the <a>
tag (see description).
是否可以对HTML表单执行相同的操作?
Is it possible to do the same for HTML forms?
例如,这是一个简单的用例:我有一个表单,要求用户提供一些详细信息,并且在用户提交表单后,服务器应根据这些详细信息返回文件.
Here is a simple use case for example: I have a form that requests the user for some details, and after the user submits the form the server should return a file according to these details.
推荐答案
这是不可能的. 根据规范,仅为 a 和区域指定的下载"属性.
This is not possible. According to the specification is the "download" attribute only specified for a and area.
http://www.w3. org/html/wg/drafts/html/master/links.html#downloading-resources
这篇关于我可以将HTML5下载属性用于HTML表单吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!