I'm looking to incorporate a bootstrap color picker into my website. I want the button inside this div to trigger the color chart and change the background color of the entire div when clicked. Can anyone help me achieve this functionality?
<div class="row">
<div class=" col-sm-4 border border-primary picker">
<!-- add a button here -->
<button class=" btn btn-primary"> select color </button>
<h4> color picker</h4>
</div>
<div class=" col-sm-8">
</div>
</div>
</div>
<script src="js/jquery-3.1.1.min.js"></script>
<script src="src/colorPick.js"></script>
<script>
$(".picker").colorPick({
'initialColor': 'onColorSelected',
'palette': ["#1abc9c", "#16a085", "#2ecc71", "#27ae60", "#3498db", "#2980b9", "#9b59b6", "#8e44ad", "#34495e", "#2c3e50", "#f1c40f", "#f39c12", "#e67e22", "#d35400", "#e74c3c", "#c0392b", "#ecf0f1"],
'onColorSelected': function() {
console.log("The user has selected the color: " + this.color)
this.element.css({
'backgroundColor': this.color
});
}
});
</script>