获取 html 中的颜色选择器值?
Get colorpicker values in html?
这是我的颜色选择器的代码。
http://jsfiddle.net/7jg4e/728/
<img id="1" alt="test" src="https:/test.com/IMGService.ashx?imagetype=typeit&postid=7406&width=100%&height=142&RenderText=[field title]&TextSize=96&TextColor=%23ff0000&BgColor=%23ffffff">
这是我的 img 标签,它是 api 将文本转换为图像。我想将颜色选择器添加到此图像标签,以便用户可以更改图像的颜色,所以我有颜色选择器,每个颜色选择器都用 javascript 或 Jquarry 输出,我们需要使用 id 标签,但我如何获得颜色名称值我的 BgColor=
我希望你明白我的意思。
我的意思是,我希望如果用户使用颜色选择器并选择一种颜色,它会在 img 中的 BgColor 中自动更新,如下所示
<img id="1" alt="test" src="https:/test.com/IMGService.ashx?imagetype=typeit&postid=7406&width=100%&height=142&RenderText=[field title]&TextSize=96&TextColor=%23ff0000&BgColor=%23**Color Picker color value Here**">
我想在此处打印颜色选择器值。可以吗
;BgColor=%23**Color Picker color value Here**">
抱歉英语不好。
let src = 'URL' + $('#color').val().replace('#','');
$('#1').attr('src', src);
ID 1 不应在 js/jquery 内有效。
这是我的颜色选择器的代码。 http://jsfiddle.net/7jg4e/728/
<img id="1" alt="test" src="https:/test.com/IMGService.ashx?imagetype=typeit&postid=7406&width=100%&height=142&RenderText=[field title]&TextSize=96&TextColor=%23ff0000&BgColor=%23ffffff">
这是我的 img 标签,它是 api 将文本转换为图像。我想将颜色选择器添加到此图像标签,以便用户可以更改图像的颜色,所以我有颜色选择器,每个颜色选择器都用 javascript 或 Jquarry 输出,我们需要使用 id 标签,但我如何获得颜色名称值我的 BgColor=
我希望你明白我的意思。
我的意思是,我希望如果用户使用颜色选择器并选择一种颜色,它会在 img 中的 BgColor 中自动更新,如下所示
<img id="1" alt="test" src="https:/test.com/IMGService.ashx?imagetype=typeit&postid=7406&width=100%&height=142&RenderText=[field title]&TextSize=96&TextColor=%23ff0000&BgColor=%23**Color Picker color value Here**">
我想在此处打印颜色选择器值。可以吗
;BgColor=%23**Color Picker color value Here**">
抱歉英语不好。
let src = 'URL' + $('#color').val().replace('#','');
$('#1').attr('src', src);
ID 1 不应在 js/jquery 内有效。