如何检测在
如何检测在
使用纯JavaScript:
this === document.activeElement // where 'this' is a dom object
或使用jQuery的:focus
伪选择器。
$(this).is(':focus');
使用jQuery的.is(":focus")
$(".status").on("click","textarea",function(){
if ($(this).is( ":focus" )) {
// fire this step
}else{
$(this).focus();
// fire this step
}