Jörn Zaefferer schrieb:
>> In the documentation (visualjquery.com <http://visualjquery.com>
>> version), it says that the $ function, when passed some HTML as a
>> string, will "create the DOM elements representing that HTML string,
>> on the fly".
>>
>> Looking at the code though (the clean function), it appears all it is
>> doing is using innerHTML - is this the case? If it is, I think the
>> documentation should be changed to better represent what is actually
>> happening. If not, can someone explain how this works to me please?
> The documentation also says that the created html is "to be (assumedly)
> inserted into the document later". That's the important point, after
> creating the element, you need to add it to the document using something
> like appendTo or prependTo. The second example demonstrates that:
> $("<div><p>Hello</p></div>").appendTo("#body")

I understand that, I just can't tell if elements or innerHTML are being inserted. As I understand it, markup that is added using innerHTML cannot be later manipulated by DOM-methods, whereas as DOM inserted (using .createElement and .appendChild) elements can be.

Matthew.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to