Right way to traverse DOM upon click