JS中如何判断一元素是否获得焦点?vart1=document.getElementById("txt1")functionisFocus(){if(document.activeElement.id=='txt1'){alert(&2023-02-21JavaScript110