chromium/third_party/blink/renderer/core/testing/data/focus_blur_events.html

<input id="field" />
<div id="message"></div>
<script>
  var field = document.getElementById('field');

  field.addEventListener('blur', function() {
    document.getElementById('message').innerText += 'blur';

    field.addEventListener('focus', function() {
      document.getElementById('message').innerText += 'focus';
    });

    field.blur();
    field.focus();
  });

  field.focus();
</script>