扫码关注官方订阅号
如何用原生JS实现获取焦点控件?
jquery:
$(":focus")
小伙看你根骨奇佳,潜力无限,来学PHP伐。
document上有个activeElement属性,直接调用就能获得focus元素:
document.activeElement;
onfocus onblur事件
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
document上有个activeElement属性,直接调用就能获得focus元素:
onfocus onblur事件