html - how to add single parent element for all the child nodes in jquery -
i have below code working fine. but, on this, when click first element [node 1], then, copied target div without parent 'ul'. same happening when click child node directly. mean, if click node 1.1, node 1.2 etc, then, these should captured inside single 'ul' element. i.e.,
this below should changed
`<li><span>node 1.1</span></li><li><span>node 1.2</span></li>`
(this getting right now)
<ul><li><span>node 1.1</span></li><li><span>node 1.2</span></li></ul>
the same should happen if select 'node 1' also.
any idea? please help.
http://jsfiddle.net/fjalsnlh/7/ kindly make amendments on fiddle link please.