Dear student,
An ionic bond is formed between a metal and a non-metal only. In case of hydrogen chloride, hydrogen and chlorine both are non-metals, so they cannot form ionic bond, however, they attract each other by covalent bond, formed by sharing of electrons.
Regards