skip to Main Content

jQuery – wrap all elements between two elements

I'm trying to wrap all of the elements between two headings regardless of what they are without having to add classes. Example: <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> <script> $(document).ready(function () { $(".axxs-accordion > :header").addClass("h-trigger static").next().wrap("<div class='section collapsed'></div>"); }); </script> <div class="axxs-accordion"> <h2>Section with…

VIEW QUESTION
Back To Top
Search