I am working on a bookmarklet project. So when user clicks on bookmarklet he can grab partial part of a web page and view it somewhere else.
The problem is that partial element (lets assume div) has css styles and classes applied.
Is there any way to loop through all child elements of selected div and convert class properties to style properties so I can keep formatting?
For example below a sample screenshot; I need to take out all applied classes and convert them into style attributes in selected area.