Is there any way I can get all styles of an element as a variable and then add them to a style attribute?
I was thinking something along the lines of
var styles = $(this).css();
$('#element').attr('style', styles);
or
var styles = $(this).css();
$('#element').css({styles});
But it's not working. I feel like there may be more to it and it's not as simple as I'm hoping.
Any help would be great!