Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-07-2012, 05:07 PM   PM User | #1
vtimbuc
New to the CF scene

 
Join Date: Nov 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
vtimbuc is an unknown quantity at this point
Live Update

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

Last edited by vtimbuc; 06-07-2012 at 05:10 PM..
vtimbuc is offline   Reply With Quote
Reply

Bookmarks

Tags
change, color, jquery, variable

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:09 PM.


Advertisement
Log in to turn off these ads.