If you're talking about the alarm that is the same as the panic alarm, i have the same problem. I rear-ended someone a while ago and ever since then, my alarm has been going off randomly, apparently because the hood switch is defunct, setting off the alarm at random.
The way I fixed it, although i don't recommend it, is to remove the fuses for the hazard lights and the alarm siren.
POSSIBLE SOLUTION:
Unplug the following fuses:
The hazard lights fuse is in the fuse box inside the car, read HAZARD.
The alarm siren fuse is in the fuse box under the hood, read ECU.
Unfortunately, you won't have any visible or audible indication you locked or unlocked the doors anymore. Even more importantly, you won't be able to use your hazard lights unless you plug it in again when needed (if you have time). I think it's illegal to drive without hazard lights available, because it could be dangerous.
Currently, I have those fuses plugged in and I'm just unplugging the main fuse to turn off the whole fuse system when i park for long periods of time, to not drain my battery, until i find a better solution.
Hope this helped!
The 2004 Hyundai Elantra has 16 valves.
The 2004 Hyundai Elantra is a gas-powered vehicle.
The 2004 Hyundai Elantra has a 5-speed manual.
The 2004 Hyundai Elantra has an inline 4 engine.
The 2004 Hyundai Elantra is 14 ft. 9.1 in. (177.1 in.) long.
The 2004 Hyundai Elantra's turning circle is 32.5 ft..
The height of the 2004 Hyundai Elantra is 4 ft. 8.1 in. (56.1 in.).
The curb weight of the 2004 Hyundai Elantra is 2635 lbs..
The 2004 Hyundai Elantra runs on regular unleaded.
The 2004 Hyundai Elantra has double overhead cam (DOHC).
The 2004 Hyundai Elantra has 53 in. of front hip room.
The 2004 Hyundai Elantra has 55.6 in. of rear hip room.