@darius one common cause for this is that your pointer has moved slightly during the click and is no longer over the element - which may have moved or transitioned or had a state change during the event. onclick requires both a down and an up on the same element to fire.
@krusynth oh right. maybe it registered as a click-and-drag by 1 pixel