Attempt at creating event delegation without jQuery