By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

DOM appendChild() after the closing tag of an element

bilibytes
100+
P: 128
Hi,

i am trying to append an list [HTML]<ul></ul>[/HTML]element after another element which is also a [HTML]<ul></ul>[/HTML] to make it look like this
[HTML]
<ul id="frist_list">
<li>some text</li>
<li>some text</li>
<li>some text</li>
</ul>

<ul id="second_list">
<li>some text</li>
<li>some text</li>
<li>some text</li>
</ul>
[/HTML]

so using xmlHttpRequest i get the second_list which i want to insert into the html document like this...
i would try with appendChild(XHR.responseText) but i dont know what to append to...

thank you

bilibytes
Sep 15 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
You need to use something like insertAfter() except that there's no insertAfter method, so you'll need a combination of insertBefore and nextSibling - see link.

PS. This doesn't belong in Coldfusion. Moved to the JavaScript forum.
Sep 15 '08 #2

bilibytes
100+
P: 128
You need to use something like insertAfter() except that there's no insertAfter method, so you'll need a combination of insertBefore and nextSibling - see link.

PS. This doesn't belong in Coldfusion. Moved to the JavaScript forum.
Thankyou very much!
PS. i missclicked on the menu bar sorry.
Sep 15 '08 #3

acoder
Expert Mod 15k+
P: 16,027
No problem. Glad your problem's solved.
Sep 15 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.