How to add a block to the page via jq?

Can't understand how to add div to the page after clicking the button.
We have here is a div
div
<div class="row_info_box">
 <div class="box_wrapper">
 <i class="fas fa-book"></i>
 <p class="name_subscription">subscription name</p>
</div>
 <div class="box considers">
 <p class="status">Depicted</p>
 <i class="fas fa-angle-down" id="arrow_info_hiden"></i>
</div>
 <div class="row_info_hiden hiden">
 <p>row 1</p>
</div>
 <div class="row_info_hiden hiden">
 <p>row 2</p>
</div>
 <div class="row_info_hiden hiden">
 <p>row 3</p>
</div>
 </div>


I decided to make the addition by pressing after a certain element (.after())
But which method append() / html() to add the block I did not understand. I would want that code in a jq looked more or less adequately. prompt who that knows, or how do you solve these problems
June 5th 19 at 21:47
2 answers
June 5th 19 at 21:49
Solution
$('html of your DIV').insertAfter('selector(s) of a specific item'); // insert after a specific element
it turns out I will not escape not beautiful code block in jq will be something like
the <div><div><p>text</p></div></div>
?? - zack commented on June 5th 19 at 21:52
"not beautiful"?
this is what?
what do you mean by "beautiful"? :) - nikolas.Reichert commented on June 5th 19 at 21:55
you can add a little bit different
$('
', { 'class': 'row_info_box', 'html': `<div class="box_wrapper"> <i class="fas fa-book"></i> <p class="name_subscription">subscription name</p> </div> <div class="box considers"> <p class="status">Depicted</p> <i class="fas fa-angle-down" id="arrow_info_hiden"></i> </div> <div class="row_info_hiden hiden"> <p>row 1</p> </div> <div class="row_info_hiden hiden"> <p>row 2</p> </div> <div class="row_info_hiden hiden"> <p>row 3</p> </div>` }).insertAfter('in the right place');
but I understand that you are little satisfied)
- nikolas.Reichert commented on June 5th 19 at 21:58
It on the contrary I was just thinking about the terrible row in
$('html of your DIV').insertAfter('<div><div><p>text</p></div></div>'); // insert after a specific element
- zack commented on June 5th 19 at 22:01
June 5th 19 at 21:51
Alternatively, you can add the desired unit in hypertext markup language(somewhere at the bottom, where you will not interfere with and hide). Using jq to find this unit and write it into a variable. And then insert that variable where you need it. So-so solution, but MB will be useful.

Find more questions by tags jQuery