[jQuery] Re: remove question

2009-06-13 Thread David .Wu
Nice trick. On 6月13日, 上午9時36分, brian wrote: > On Fri, Jun 12, 2009 at 2:37 PM, amuhlou wrote: > > > putting it all together, you'd get something like: > > > $('#div1').replaceWith($('#div2')).remove(); > > > first you find div1, then replace it with div2, then remove div1 > > There's no need for

[jQuery] Re: remove question

2009-06-12 Thread brian
On Fri, Jun 12, 2009 at 2:37 PM, amuhlou wrote: > > putting it all together, you'd get something like: > > $('#div1').replaceWith($('#div2')).remove(); > > first you find div1, then replace it with div2, then remove div1 There's no need for remove() because it will have been replaced already.

[jQuery] Re: remove question

2009-06-12 Thread amuhlou
putting it all together, you'd get something like: $('#div1').replaceWith($('#div2')).remove(); first you find div1, then replace it with div2, then remove div1 On Jun 12, 2:12 pm, Kean wrote: > W3C says that id should not start with a number > > Here's probably what you need. > > $('#1').rem

[jQuery] Re: remove question

2009-06-12 Thread Kean
W3C says that id should not start with a number Here's probably what you need. $('#1').remove(); On Jun 11, 7:44 pm, "David .Wu" wrote: > Can I remove div1 but div2 keep there? > > > >

[jQuery] Re: remove question

2009-06-11 Thread brian
On Thu, Jun 11, 2009 at 10:44 PM, David .Wu wrote: > > Can I remove div1 but div2 keep there? > > > > 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_

[jQuery] Re: remove question

2009-06-11 Thread Steven Yang
i guess you just have to move div 2 somewhere else before you remove div 1