All dryers use electricity as a power source, but a gas dryer also has a gas line that runs from the back of the dryer to the natural gas outlet. Gas dryers also have standard plugs because they don't require as much power as the fully electric models.
Electric dryers sold at appliance stores do not have cords. They are sold separately because the plug must match the receptacle, which has either three or four prongs, and delivers 240V of power. If the back of the dryer has a large wire going into a junction box, but no plug, it is an electric dryer. If a cord with a standard 115V plug is attached, it's a gas dryer.
The gas connector, which also must be purchased separately, is usually made of stainless steel and is often coated with a yellow substance. The gas is used to create the heat for drying clothes, while the electricity is used to run the motors and the timers.
Installing an electric dryer is a matter of plugging it in once the correct plug is attached, while a gas dryer should be professionally connected. Most gas dryers are set up for natural gas, but there are conversion kits for LP-gas or propane, which must be attached before the installation.