问题描述
我有一个选择文件"按钮如下(我用的是 Jade 但它应该和 Html5 一样):
I have a button "Choose file" as follows (I am using Jade but it should be the same as Html5):
input(type='file', name='videoFile')
在浏览器中,这会显示一个按钮,旁边有一个文本未选择文件".我想将未选择文件"文本更改为其他内容,例如未选择视频"或请选择视频".我遵循了这里的第一个建议:
In the browser this shows a button with a text next to it "No file chosen". I would like to change the "No file chosen" text to something else, like "No video chosen" or "Choose a video please". I followed the first suggestions here:
但是这样做并没有改变文本:
But doing this did not change the text:
input(type='file', name='videoFile', title = "Choose a video please")
谁能帮我找出问题所在?
Can anybody help me figure out where the problem is?
推荐答案
我很确定您无法更改按钮上的默认标签,它们在浏览器中是硬编码的(每个浏览器都以自己的方式呈现按钮标题).查看这篇按钮样式文章
I'm pretty sure you cannot change the default labels on buttons, they are hard-coded in browsers (each browser rendering the buttons captions its own way). Check out this button styling article
这篇关于更改“未选择文件":的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!