Although the diets of the two variations of these beasts are somewhat similar, they do differ in a few ways worth mentioning. The broad answer to your question about what do elephants eat is that elephants are strictly herbivores. This means that they eat only plants and vegetation, so don't worry, you're safe. Exactly what kind of vegetation they eat depends a lot on the habitat in which they live and what plants are available to put into their growling stomachs. In the wild, African elephants eat mostly leaves and roots with a supplementary snack diet of fruit and grasses. A hungry African elephant will eat just about any plant that gets in his way, and that includes flowers and even sometimes twigs. During dry spells, African elephants have been known to knock entire trees to the ground and strip them for nutrients. They will start with the dense foliage at the top of the tree, consuming first the tender leaves and shoots. After that is all safely packed away into their bellies, they may continue their literally all-you-can-eat buffet by stripping the bark off the sides of the tree and eating it. If times really get tough, they'll even eat some of the smaller branches for dessert.
Asian elephants eat many of the same things as African elephants. Because of the environment in which they live, the scales of their diet are tipped more toward grasses and shrubs and less toward leaves. An interesting addendum to the question of what do elephants eat is how they eat it. Asian elephants tend to grab trunk fulls of long grasses with their even longer noses, pluck these bundles right out of the ground, and put them into their mouths. To eat shorter grasses, an Asian elephant will kick at the dirt in which the grass grows until the tiny stalks come loose, after which he will sweep the loose grass into his mouth with his trunk. Before we start picking daisies - which any elephant would love to eat, by the way - you may be interested to know that elephants drink between 40 and 50 gallons of water every day to supplement their feasts of leaves, grass, and sticks. If food or water is not readily available, Asian elephants may use their tusks like shovels to dig for either water or roots, whichever they unearth first. Other animals often come and try to drink from the pools dug up by elephants.