deccc
deccc

Reputation: 77

Get colorpicker values in html?

Here is the code of my color picker. http://jsfiddle.net/7jg4e/728/

<img id="1" alt="test"  src="https:/test.com/IMGService.ashx?imagetype=typeit&amp;postid=7406&amp;width=100%&amp;height=142&amp;RenderText=[field title]&amp;TextSize=96&amp;TextColor=%23ff0000&amp;BgColor=%23ffffff"> 

Here is my img tag which is api convert text into image. i want to add colopicker to this image tag so user can change the color of image so i have colorpicker and every colorpick's out put with javascript or with Jquarry we need to use id tag but how i can get color name value in my BgColor=
I hope you understand my point. i mean i want if user use color picker and pick one color its automatic update in BgColor in img filed like bellow

<img id="1" alt="test"  src="https:/test.com/IMGService.ashx?imagetype=typeit&amp;postid=7406&amp;width=100%&amp;height=142&amp;RenderText=[field title]&amp;TextSize=96&amp;TextColor=%23ff0000&amp;BgColor=%23**Color Picker color value Here**">

I want print colorpicker value here. is it possible

;BgColor=%23**Color Picker color value Here**">  

Sorry For Poor English.

Upvotes: 0

Views: 117

Answers (1)

Jaapaap
Jaapaap

Reputation: 221

let src = 'URL' + $('#color').val().replace('#','');
$('#1').attr('src', src);

Id 1 should not be valid within js/jquery.

Upvotes: 2

Related Questions