We investigate the effect of liquid elasticity on the transient cavitation bubbles confined in a tube both experimentally and theoretically. In experiments, the tube-arrest apparatus is used to generate cavitation bubbles near the tube bottom with various polyethylene oxide solutions. Our experiments show that bubble dynamics, particularly the maximum bubble length, are significantly influenced by liquid elasticity. We establish a double oscillator model for the liquid column to explain the experimental results and predict the bubble dynamics over a broader range. Finally, we propose that the reciprocal of the cavitation number Ca2 and prR/k determine the regimes of the liquid column separation, where pr is the reference pressure, R is tube radius, and k is the “stiffness coefficient” of the liquid column. Our work provides a quantitative scaling of the dynamics of large cylindrical cavitation bubbles in viscoelastic liquids during the transient process.