Unrelated, but for my own education...
Why clicking on \<span\> tags and not the nested \<a\>? Or using a \<button\> instead of a span?

This is the only place I see that we're clicking on a span and not an \<a\> or \<button\>.