On Thu, Jun 11, 2009 at 10:44 PM, David .Wu<chan1...@gmail.com> wrote: > > Can I remove div1 but div2 keep there? > > <div id="1"> > <div id="2"></div> > </div>
Someone (Karl?) answered the same question recently. You just replace the outer div with the inner. Note that you can't have an element ID starting with a number, though. Let's call them div_1 & div_2. $('#div_1').replaceWith($('#div_2'));