How can I make jquery put all of the divs with specific class into a container? I would like to have a function, that would move divs dynamically. So that when a div gets the new class, it automatically gets moved to this container.
Is this possible?
To move them:
Or perhaps, to avoid touching ones already in the container:
For elements that already exist in the DOM the
.append()method moves them to the new parent that you specify.I’m not aware of an event that is triggered by a change in class, so I’m not sure what to suggest as far as having it happen automatically.