I have been using jQuery to create a simple child list, however the style of child list I am generating is as thus:
parent
-> child1
-> child2
-> childN
The style of list I want to generate needs to render like this.
parent
-> child1
--> child2
--->childN
So that a child is appended a new child node.
Currently I have been utilising jQuery’s .last().append() features however they only seem to be able to generate example 1 and for some reason i can not for the life of me work out this very basic problem, should I utilise prepend(), but i feel as though that may not work correctly ?
var nodeSets = document.createElement(arrayElems[0]);
for (var i=1; i < arrayElems.length; i++) {
$(nodeSets).last().append(document.createElement(arrayElems[i]));
}
HTML
javascript:
http://jsfiddle.net/BhZtu/1/