gpt4 book ai didi

html - firefox 中文件输入的标签

转载 作者:太空狗 更新时间:2023-10-29 14:21:28 26 4
gpt4 key购买 nike

当我在表单输入中添加标签时,我通常可以单击该标签,它会将我引向适当的输入(见下文)。

<label for="input">Label</label><input type="text" id="input"/>

但是,当我尝试使用文件输入完成相同操作时,点击标签会被忽略。这是一个错误吗?一个特征”?还有什么办法可以做到这一点吗?

jsFiddle 测试用例:here

最佳答案

标签的规定行为因 HTML 规范而异。

更准确地说,这可能是 FF 中的错误(而不是其他功能中的额外功能),因为根据 HTML 4 规范通常应包含此行为: When a LABEL element receives focus, it passes the focus on to its associated control. See the section below on access keys for examples.

current HTML spec更细微,但确实表明它可能什么都不做(这是 iOS 中的预期行为)。

关于html - firefox 中文件输入的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7516882/

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