WHILE loop and get elements by class name

How do I search for all elements by class name then remove them from the DOM with a while loop.