autofocus同时生效几个?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!DOCTYPE html> < html > < head > < meta charset = "UTF-8" > < title >autofocus</ title > </ head > < body > < form action = "3-2 form(autofocus属性).html" autocomplete = "on" > < input type = "text" name = "text" autofocus = "autofocus" > < input type = "email" name = "email" autocomplete = "off" autofocus = "autofocus" > < input type = "submit" > </ form > </ body > </ html > |
请问autofocus同时生效几个?如上,我在text和email里面都写了,但是效果出来只有text生效了
38
收起
正在回答
3回答
只能生效一个,如果你两个都去写了autofocus 那么默认的你最先写的那个有autofocus效果,由于你的text 比email优先,所以text有autofocus效果而email没有
Yuyu_coder
2017-02-09 07:49:50
只能生效一个,因为不可能同时输入2个框啊
HTML5与CSS3实现动态网页 2018
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧