How do you tell if an input or textarea has focus in native javascript?
This is not a duplicate as it asks for a native Javascript solution!
How do you tell if an input or textarea has focus in native javascript?
This is not a duplicate as it asks for a native Javascript solution!
Native Javascript (>= IE 8)
!~[].indexOf.call(document.querySelectorAll("input, textarea"), document.activeElement)