Skip to content

Instantly share code, notes, and snippets.

View aitchiss's full-sized avatar

Suzanne Aitchison aitchiss

View GitHub Profile
@aitchiss
aitchiss / showFocus.js
Last active January 3, 2021 15:30
Log the currently focused element as it changes (can use in the devtools console for debugging)
document.body.addEventListener('focusin', event => console.log(document.activeElement));
<ul class="list-no-bullets">
<li>
<img src="./decorative-bullet.png" alt="" />
List Item One
</li>
<li>
<img src="./decorative-bullet.png" alt="" />
List Item Two
</li>
</ul>