Novel ionenes with allyl pendant groups have been synthesized by condensation of N,N'- bisallylpiperazine with organic dihalides such as 1,4-dichlorobutane, 1,6-dibromohexane and 1,4-dichloromethylbenzene. The polymers are readily soluble in water and have low molecular weights. The structure of the ionenes has been identified by spectroscopic techniques. The concentrated aqueous solutions of the resulting ionenes can be crosslinked by t-butylhydroperoxide as a radical initiator to give transparent hydrogels. The ionenes also act as an crosslinking agent in copolymerization with high concentrations of acrylic acid in the presence of K2S2O8 as a radical initiator in water at 65 degrees C.