I have some nested lists and I want to be able to insert a previous level element:
<ul>
<li>Item 1
<ul>
<li class="selecteditem">Item 1.1</li>
<li>Item 1.2</li>
<li>Item 1.3</li>
</ul>
</li>
<li>Item 2</li>
</ul>
<!-- language: lang-js -->
//I try to do it as follows:
$('li.selecteditem').after('</ul></li><ul>"...
But the after() method only allows to insert DOM nodes, so all the closed tags "" are ignored. Is there a way to inject this html string literally exactly where I want it?
Thanks in advance for your help