If I understand correctly, you want to dynamically put a <ul>
inside a <li>
returned by AJAX and if I understand correctly you want to do it with JQUERY. I put here an example that responds to what I understood in the question.
html:
<ul id="teste">
<li></li>
<li></li>
</ul>
No JQUERY:
$("ul#teste li").each(function () {
var retorno_ajax = "<ul><li>sub-linha1</li><li>sub-linha2</li></ul>";
$(this).html(retorno_ajax);
});
each
accesses dynamic content as well. Do not forget that .html
will delete the previous content and put the new one for the example. However if you want to add the return to existing content within li
then use append
.