Hi,
The gravitational force is the natural phenomenon. All the matters in the universe have a gravitational force. As earth is a matter, therefore it has gravitational force.
It is not a element in the earth which attracts all the things towards it. Gravitational attraction is caused by whole earth.