I am trying to clear all classes and ids of an element and its children. But my current code only clearing classes and ids only from the parent.
Please tell me how I clear all classes and ids of an element and its child.
Here is my code:
jQuery('#menu-main-menu').clone()
.removeAttr('id').removeAttr('class').prependTo('body');