This is a discussion on "AppendChild after ID" within the JavaScript Forum section. This forum, and the thread "AppendChild after ID are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
AppendChild after ID
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
AppendChild after ID
I have a div containing a few elements. Is it possible to append a child after an element with a certain ID?
Eg: <div id="container> <div id="child1"></div> <div id="child2"></div> </div> Could I append a child after child1, to give: <div id="container> <div id="child1"></div> <div id="child1a"></div> <div id="child2"></div> </div> |
|
|
|
||||
|
Re: AppendChild after ID
There's the long way (which is ugly and takes a lot to learn) and there's the jQuery way:
Step 1: Get jQuery Step 2: Use the after method to insert HTML after an element.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Tags |
| element, javascript |
| Thread Tools | |
|
|