jQuery on bullur

$("#yourElement").on('blur', () => {
    // your code
    alert('ok');
});
lff