If ideal quotients of a ring are isomorphic, are these ideals isomorphic?

$\Bbb R[X,Y]/(X)\simeq\Bbb R[X,Y]/(Y)$ but $(X)\neq(Y)$. The question should be if $I$ and $J$ are isomorphic as $R$-modules.


We can also consider $$\left(\prod_{n=1}^\infty\mathbb{Z}\right)/\mathbb{Z}\cong\left(\prod_{n=1}^\infty\mathbb{Z}\right)/(\mathbb{Z}\times\mathbb{Z}).$$ Clearly $\mathbb{Z}\not\cong\mathbb{Z}\times\mathbb{Z}$ since $\mathbb{Z}$ only has one generator while $\mathbb{Z}\times\mathbb{Z}$ has two generators.