why only iron, cobalt & nickel are attracted towars magnet
Iron, Cobalt, Nickel, Neodymium are ferromagnetic substances. These substances are special in the sense; first of all they have unpaired electrons in the valence orbital which act as magnetic dipoles. These substances with unpaired electrons are called paramagnetic substances. But that is not enough to make them ferromagnetic because of thermal vibrations and dipole-dipole interactions dipoles do not align themselves to form magnetic domains in normal paramagnetic substances like oxygen.
But in ferromagnetic elements there the exchange energy overcomes the dipole-dipole interactions and thermal fluctuations to make the dipoles align to form domains. Thus when these substances are brought near magnets the dipoles inside them becomes aligned and magnetic force is experienced.
Other materials may not be attracted by magnets because