Use onclick
and onfocusout
vanilla js (or Jquery) events (using the addEventListener() method).
This is ± the outline (select element X and run Function Y on Event):
Jquery option:
https://api.jquery.com/focusout/
Add read-only link for specific example.