context = document.createElement("span");
start_element = my_start_element;
end_element = my_end_element;
// some how iterate through here (assuming start and end are different elements)
[start_element .. end_element].each(function(current_element){
context.append(current_element);
});
pretty straight forward, just don’t know how to do the loop part with the start and end nodes. =\
You can also accomplish this with the plain
DOMandDocumentFragment.Assuming that the start and end nodes are siblings and you have the following html:
The following JS will copy the nodes and insert them in another place.