The visitors were dealt an early blow when Grant Basey was stretchered off with a suspected broken leg and they fell behind when Elliott volleyed in.
Heffernan sealed the win when he burst clear to unleash a powerful right-footed shot into the net.
Therry Racon's injury-time 20-yard strike was a consolation for Charlton.