Is there a way to cut and paste or clone CSS from one element to another using JQuery?
- by Jared Christensen
I have a situation where I'm wrapping an image with a span and I want to remove all the CSS from the image and apply it to the span. Is there a way to do this with JQuery?
JQuery:
$(img).wrap('<span />');
Style Sheet:
img { border: 5px solid red; padding: 10px; … }
I would like do to do this with out editing the HTML or CSS. For example adding a class to the image would not work very well in my situation. I need a way to truly remove the CSS from one element and place it on another.