I have a parent container with a unique background color. Inside the parent container, there is an unordered list (ul) with multiple list items (li), each having a distinct color and a brighter border color. Now, I am looking to extract the border color of the li elements and apply it as the background color for the parent container.
<div class="content">
<ul class="list">
<li class="item"></li>
<li class="item"></li>
<li class="item"></li>
</ul>
</div>
Although I found jQuery code that successfully copies the background color, it does not work for the border color specifically.
$(document).ready(function(){
$("li.item").click(function(){
var bg = ['background-color',];
var $this = $(this);
$.each(bg , function(item, value) {
$("div.macbook-content").css(value, $this.css(value));
});
});
});
If anyone has any insights on how to achieve this, please feel free to share your suggestions.