Best way to create nested HTML elements with jQuery [closed]
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . If I need to create a couple of nested DOM elements, I know one way to do it, is to write them as long string and then place them in the document using a suitable jQuery function. Something like: elem.html( '<div class="wrapper"> <div class="inner"> <span>Some text<span> <