focus()

jQuery focus()怎么用
JavaScript

jQuery focus()怎么用

172 0

jQuery focus()的用法:首先通过【ready()】方法在页面加载完成时,通过id获得input对象并给它绑定focus焦点事件;然后当input获得焦点时,执行function方法;最后通过【val()】方法获得input内容。本教程操作环境:windows7系统、jquery3.2.1版本,Dell G3电脑。jQuery focus()的用法:1、新建一个html文件,命名为test.html,用于讲解jquery中focus()方法有什么作用。2、在test.html文件内,使用inpu