Michael replied:

> A single node can't appear twice in the DOM. But you can easily clone a
> node.
>
> http://docs.jquery.com/DOM/Manipulation#clone.28_deep_.29

Ok, thanks.  One thing I partially disagree with that Simon fella and
his excellent jQuery writeup, was the idea that if you can separate
yourself from understanding how jQuery works with foundation, then you
can discovery the power and make productive use of jQuery.  I
generally agree, but ultimately to be an expert with jQuery, you have
to solid understanding of DOM and how jQuery uses DOM.

I have to remember that a variable is a "node" in the DOM tree. Does
that mean that when it initially created, it is hidden?

> First, let's call your variable $inputBox instead of inputBox so I won't get
> confused. :-)
>
> (A common - and helpful - convention is to use a $ prefix on a variable
> containing a reference to a jQuery object, as a reminder that it's a jQuery
> object.)

Yes, I wondered about that when Karl used it without the $ sign.  I am
a stickler to good style and convention. Points like this is very
helpful.

> Then, do a deep clone of $inputBox each time you want to append it:
>
>    $inputBox.clone(true).appendTo('#myForm');
>    $inputBox.clone(true).appendTo('#myForm');
>
> I think that should do the trick.
>

Thank you Michael. Your feedback is always useful, productive and
helpful. :-)

PS: Where's the book? <g>

---
HLS

Reply via email to