The nitrogen-containing olefinic compounds having the formula of R1 C(R1)???C(R1)--(C???O)m --(NH)m --(Ar)m --Y--N+ (R2)(R2)--Y--SO3 - (a sulfobetaine), can be produced by contacting a vinylic tertiary amine with an alkylating agent such as, for example, an alkylsulfonic acid containing a proper leaving group such as halide, hydroxyl, rosylate, other suitable leaving groups, or combinations of any