what I need to do is adding some html markup as string/text to a div .result
I already tried to do this by using .text()
function
for (i = 0; i < 5; i++) { $('.result').text('<p class="para-' + [i] +'">Paragraph</p>' ); }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="result"></div>
but this only adds the last paragraph into the .result then I tried to use the .append function but this one taking the string a markup and adds it to the page DOM.
can you please let me know how to do this?
Thanks