我可以't编辑我的<输入类型=“;文件“>标签

I can't edit my <input type="file"> tag

本文关键字:文件 gt 标签 类型 lt 编辑 我的 我可以 输入      更新时间:2023-09-26

我无法编辑此按钮,我尝试使用引导程序javascript。这是我的代码示例。如有任何帮助,将不胜感激

<html>
    <head>
        <script type="text/javascript" src="assets/js/bootstrap-filestyle.js"> </script>
        <script>
            $(":file").filestyle({input: false});
        </script>
    </head>
    <body>
        <input type="file" class="filestyle" data-input="false">
    </body>
</html>

简单回答:你不能。文本由浏览器预定义。

解决方法可能是使用图像或第三方文件上传器
查看以下相关答案:如何更改<输入类型=";文件"/>?

我认为您要做的是将文本"Choose file"替换为其他内容;

如果是这种情况,请尝试以下语句。

抱歉,没有足够的信誉发表评论。

<input type='file' style='opacity: 0; width:90px; position: absolute; z-index:2'>
<button class='btn-margin btn grey' style='z-index: 1;width:90px;cursor:pointer;'>Browse</button>";