gpt4 book ai didi

jquery - 使用按钮隐藏输入类型 "file"

转载 作者:技术小花猫 更新时间:2023-10-29 12:09:21 25 4
gpt4 key购买 nike

我想知道这是否可行?谷歌一无所获。

基本上我想让我的按钮在被选中时模拟,允许用户上传文件。我已经读过标签的可能性,但我需要用一个按钮来做 UX/UI

<button style="position:fixed;bottom:10px;right:70px" type="button" class="btn btn-default">
<input type="file" id="files" visbility="hidden" />
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
</button>

目前我的按钮是这样的: enter image description here对此:

enter image description here

最佳答案

您实际上可以使用 label 来做到这一点,您只需要隐藏 input

<!-- head -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>

<!-- body -->
<label for="upload">
<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
<input type="file" id="upload" style="display:none">
</label>

关于jquery - 使用按钮隐藏输入类型 "file",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29251099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com