Is there a way to assign unique classes to all elements in an HTML document or output within WordPress? This would make editing and styling the code much easier as each element would have its own distinct class. While I am aware that you can select classes using parent classes in CSS, it becomes challenging when dealing with multiple elements having the same parent class.
I have considered using jQuery's addClass function on $(body *) with a loop, but this might not permanently fix the classes to the elements. Additionally, any new code added could alter the classes every time the document loads, disrupting the CSS styles applied to different elements. While it may not be feasible for standard HTML without utilizing a database, achieving this functionality within WordPress would be highly beneficial.