Listener zdarzeń dla elementu utraconego ostrości

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

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

form.addEventListener('focusout', (event) => {
  event.target.style.background = 'black';
});
Abiral Lamsal