When the page is loaded into input type="color" there is a value , which already contains the default color #0000ff - I try to do it via trigger("input") , but nothing happens:
<input id="csmenu-1" value="#ff0080" class="js-csmenu-1" type="color"> $(".js-csmenu-1").trigger("input"); $(".js-csmenu-1").on("input", function() { var val = $(this).val(); $(".js-view-csmenu").css("backgroundColor", val); });