Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if an input element has focus

const el = document.querySelector('.username');
console.log(el === document.activeElement);Code language: JavaScript (javascript)
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #check #input #element #focus
ADD COMMENT
Topic
Name
3+4 =