"If INDOORS, stay indoors. Move away from windows that may break and furniture or large objects that could fall over. Take cover under a table, bench or desk and hold on, or go to an interior wall or hallway. Expect fire alarm and sprinkler systems to activate.
If you're in a CROWDED ROOM OR PUBLIC PLACE, do not rush for exits. If outdoors, stay outdoors. Move to an open area away from trees, buildings, utility poles and lines, or signs.
If in a VEHICLE, pull to the side of the road as quickly as possible, but keep away from overhead hazards such as trees, buildings, utility poles and lines, signs, and bridges. Stay in the vehicle until the shaking stops.
If you're in a THEATER OR STADIUM, stay in your seat or get under it if possible, and protect your head with your arms. Do not try to leave until the shaking is over."
The words above are quoted from:
http://www.washington.edu/admin/business/oem/hazards/earthquake.html
I prefer this answer which includes BEFORE, DURING & AFTER three periods. Also, you can surf this website for reference:
http://seagrant.uaf.edu/features/earthquake/prepare2.html
"What to do during an earthquake
1. If you are indoors, duck or drop down to the floor. Take cover under a sturdy desk, table or other furniture. Hold on to it and be prepared to move with it. Hold the position until the ground stops shaking and it is safe to move. Stay clear of windows, fireplaces, woodstoves, and heavy furniture or appliances that may fall over. Stay inside to avoid being injured by falling glass or building parts. If you are in a crowded area, take cover where you are. Stay calm and encourage others to do likewise.
2. If you are outside, get into the open, away from buildings and power lines.
3. If you are driving, stop if it is safe, but stay inside your car. Stay away from bridges, overpasses and tunnels. Move your car as far out of the normal traffic pattern as possible. If possible, avoid stopping under trees, light posts, power lines, or signs.
4. If you are in a mountainous area, or near unstable slopes or cliffs, be alert for falling rock and other debris that could be loosened by the earthquake.
5. If you are at the beach, move quickly to higher ground or several hundred yards inland."
Summarizing these information and you'll get a comprehensive answer.