Hi everyone,

how do I go about appending some HTML to the same selection x-amount of times? For example, I might want to append a paragraph 3 times to the same div.

So I'd have:

HTML Code:
<p id="computer" name="computer">hi there<p>
<p id="computer" name="computer">hi there<p>
<p id="computer" name="computer">hi there<p>
I'm using a select menu with numbered options from 0-6. When someone selects option 3, 3 instances of the same paragraph should be appended to the selection. If 5 is selected, 5 paragraphs would be appended. What I'd also like is for the name attribute to be incremented with a number.

So I'd have:

HTML Code:
<p id="computer" name="computer[0]">hi there<p>
<p id="computer" name="computer[1]">hi there<p>
<p id="computer" name="computer[2]">hi there<p>
Code:
<script>
      $(document).ready(function() {
 
        $("#selectmenu").on('change', function () {
        $("#content").append().html('<p id="computer" name="computer">hi there<p>');
        }
        );
      });
    </script>
I'll probably have to include a loop somewhere?


Please assist me with this.

Thank you.