ureech,
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
.component {
background-color: Chocolate;width:100%; height: 100px; margin-top: 10px;
}
</style>
</head>
<body>
<div class="tabs-wrap">
<button class="tab" data-color="gray">Gray</button>
<button class="tab" data-color="red">Red</button>
<button class="tab" data-color="blue">Blue</button>
</div>
<div class="component" ></div>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script>
$(function() {
var a = $(".component").css("backgroundColor");
$(".tabs-wrap").on("click", ".tab", function() {
var b = $(".component").css("backgroundColor"),
c = $(this).data("color");
$(".component").css({
backgroundColor: c
});
$(".component").css("backgroundColor") == b && $(".component").css({
backgroundColor: a
})
})
});
</script>
</body>
</html>