Jquery ‘remove class’ – trying to remove all elements with a particular class


So I have 2 divs, each with n-elements.
There are n-pairs of elements across the 2 divs.
Each pair uses the same 'class'.

Is it possible to remove a particular pair at a time? I currently am using the following code:

    function leaveGroup(id)

        var e = document.getElementById(id);
        var f = $(e).parentNode;

        // Remove everything with the same class name of the parent


The function isn't working, am I using class names incorrectly?

Best Solution

// would remove all elements with the 'el' className

I believe this is what you want. removeClass removes a class. remove removes the element.