1.获取焦点: $("#id").focus();
2.失去焦点:$("#id").blur();
注:在获取焦点时,如果失败了,可以延时50ms
eg:setTimeout(function (){$("#id").focus();},50);
3.焦点事件: onBlur:当失去输入焦点后产生该事件
onFocus:当输入获得焦点后,产生该事件
Onchange:当文字值改变时,产生该事件
eg:
<input onFocus="function(){}"></input>
转载请注明原文地址: https://ju.6miu.com/read-969273.html