sibling background color
by rupesx
HTML
<section class="blog-post-wrapper"></section>
<section class="app-showcase-section"></section>
CSS
section{
height: 300px;
}
section:nth-child(odd){
background-color: red;
}
section:nth-child(even){
background-color: green;
}
JavaScript
bgColor('.blog-post-wrapper', '.app-showcase-section');
alert(1);
var bgColor = function(sibFrom, sibTo){
var sibFormBg = $(sibForm).css('background-color');
$(sibTo).css('background-color', sibFormBg);
console.log(sibFormBg);
}