Hey Guys,
I have a variable that is updated with the color that is chosen on a colorpicker.
And I want to use this variable to change the color code that appears on a element.
This is the code:
Code:
$('#color').ColorPicker({
onChange: function (hsb, hex, rgb) {
var code = hex;
}
});
$('#teste').text(code);
The variable "code" is updated when the user chose another color on the colorpicker but the text doesn't change. I cant put the "$('#teste').text(code);" code in the onChange event so I want to ask you how to change the text when the variable is updated.
Thanks