Is there a way to cut and paste or clone CSS from one element to another using JQuery?
Posted
by Jared Christensen
on Stack Overflow
See other posts from Stack Overflow
or by Jared Christensen
Published on 2010-05-13T16:46:32Z
Indexed on
2010/05/13
17:04 UTC
Read the original article
Hit count: 204
jQuery
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.
© Stack Overflow or respective owner