Javascript 我能';t编辑我的<;输入类型=";文件"&燃气轮机;标签

Javascript 我能';t编辑我的<;输入类型=";文件"&燃气轮机;标签,javascript,twitter-bootstrap,Javascript,Twitter Bootstrap,我无法编辑此按钮,我尝试使用引导javascript。这是我的代码示例。任何帮助都将不胜感激 <html> <head> <script type="text/javascript" src="assets/js/bootstrap-filestyle.js"> </script> <script> $(":file").filestyle({input: false});

我无法编辑此按钮,我尝试使用引导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>

$(“:file”).filestyle({input:false});

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

解决方法可能是使用图像或第三方文件上传程序。

看看这个相关的答案:

我想你要做的是把文本“选择文件”替换成其他内容

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

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

<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>";

浏览”;

只需清除或隐藏输入[type=file],并使用“选择文件”组合触发对文件输入的单击,同时接受按钮上的CSS样式即可。