js event to add dots in grid