jQuery DOM element creation vs innerHTML
问题 While having one of my questions answered, cletus mentioned that when creating elements in jQuery it's better to use direct DOM element creation , instead of innerHTML . I tried googling it but I wasn't able to find a good article with comparisons. I've provided this code bellow as an example and I was wondering if someone could help me rewrite it in direct DOM element creation form in hope that i would also learn the difference afterwards. var img = $(this); img.append('<p class="cap"><a