javascript
function fetchc(){
pclr=document.getElementById("product_color").value;
clr.push(pclr);
var n=clr.length;
$("#colors").show();
for (var i=0;i<n;i++)
{
$("#colors").append('<input type="color" value="'+clr[i]+'" disabled>')
}
console.log(clr);
}
html
<div class="form-group form-inline">
<label for="product_color"> Select product Color</label> 
<input type="color" class="form-control" id="product_color"placeholder="Product color" style="width: 100px;" onchange="fetchc();">
<div id="colors" style="display: none;"></div>
</div>
Although the desired output is achieved, the appending of elements based on array length needs to be adjusted to prevent duplication.