Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

event listener for element lost focus

const form = document.getElementById('form');

form.addEventListener('focusin', (event) => {
  event.target.style.background = 'pink';
});

form.addEventListener('focusout', (event) => {
  event.target.style.background = 'black';
});
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #event #listener #element #lost #focus
ADD COMMENT
Topic
Name
7+6 =