I can’t change the markup because it’s generated by my CMS.
Therefore, I need my current markup:
<details class="js-form-wrapper>
<summary></summary>
<div></div>
<div></div>
<table class="responsive"></table>
<div class="js-form-type-managed-file"></div>
</details>
To become like this using JQuery:
<details class="js-form-wrapper>
<summary></summary>
<div></div>
<div></div>
<div class="my-wrapper">
<table class="responsive"></table>
<div class="js-form-type-managed-file"></div>
</div>
</details>
2
Answers
There’s probably a few ways to do this but a simple one would be:
You can use .wrapAll() and call multiple elements since they are not under one parent tag