$(function() {
$('#colorpickerField').ColorPicker({
onSubmit: function(hsb, hex, rgb, el) {
$(el).val(hex);
$(el).ColorPickerHide();
},
onBeforeShow: function () {
$(this).ColorPickerSetColor(this.value);
}
})
.bind('keyup', function(){
$(this).ColorPickerSetColor(this.value);
});
$(".colorpicker").css("zIndex",99);
});
<p>
<label style="text-align: right; 80px;">颜色:</label>
<input type="text" name="colorpickerField" id="colorpickerField" size="30" value="${warnrepairrule.color }"/>
</p>
<tr>
<td style=" 20%;text-align: center;" >颜色</td>
<c:forEach items="${warnrepairrule }" var="list" varStatus="s">
<td style=" 10%; background-color: #${list.color};" > </td>
</c:forEach>
</tr>