Search code examples
jqueryinputcolor-picker

Jquery Colorpicker show value in inputfield


I use this colorpicker plugin:http://www.eyecon.ro/colorpicker/

How can i show the start value in the inputfield?

Here is a JSFiddle what i have: http://jsfiddle.net/z6Ddy/


Solution

  • Dont use attr to set a value

    $('#colorSelector input').attr('value', '#' + hex);
    

    Instead use

    $('#colorSelector input').val('#' + hex);