html <input type=”text” id=”input” /> js判断当前元素是否获取到了焦点 var input = document.getElementById(‘my_input’), hasFocus = document.hasFocus() && document.activeElement === input; //如果hasFocus为t…
html <input type=”text” id=”input” /> js判断当前元素是否获取到了焦点 var input = document.getElementById(‘my_input’), hasFocus = document.hasFocus() && document.activeElement === input; //如果hasFocus为t…