How to call a method when focusout

How to call a method when focusout like jquery focusout

like this => ```
$(“input”).focusout(function() {

})

you can do it with pure js easily

let’s say you have a form and you want to change the background when losing the focus.

HTML markup

<form id="form">
  <input type="text" placeholder="text input">
  <input type="password" placeholder="password">
</form>

javascript code

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

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

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

I hope you got the point.

source

thank you
but i have call method in livewire/component for update db

In this case, you can use events that’s chips with livewire.
You can Read More About it here

Please give an example