When I flashed my brights( not engaged) my car sputtered like it was going to stall and the check engine light appeared for a moment. this repeated itself. Also when I engaged my fog lights first then the headlights some funny happenings took place such as the radio shutting down and resetting. The only new thing was headlights replaced
sounds like you may either have a short in your positive battery cable or it's not tightened down enough, suggest tightening the bolt and using a metal brillo pad to clean the inside of the terminal first, and if that doesn't work replace the terminal next.
Search Hyundai Elantra Questions
Hyundai Elantra Experts