JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main">
<input type="color" id="colorinput" />
</div>
CSS
#main {
height: 200px;
background-color: cornflowerblue;
}
JavaScript
jQuery('#colorinput').on('input', function() {
jQuery('#main').css('background-color', jQuery(this).val());
}).focusout(function(){
alert("out");
});