<input id="input"></input>
使输入框聚焦:
document.getElementById('#input').focus()
判断输入框是否聚焦:
if( document.getElementById('#input')==document.activeElement ){
// 聚焦状态
}
<input id="input"></input>
使输入框聚焦:
document.getElementById('#input').focus()
判断输入框是否聚焦:
if( document.getElementById('#input')==document.activeElement ){
// 聚焦状态
}