I would like to know the best way to accomplish the following task: Using jquery or pure javascript code for copy the style of one dom element to another.
example:
// css file
div.myClass {
color: red;
}
// html file
<div class="otherClass">
no style
</div>
// js script
var propertyName = color;
$("div.otherClass").css( propertyName , function () {
return $("div.otherClass").css(propertyName);
} )
The js script works but I would like to take the propertyName automatically. Any idea?