Help with color picker

I have a javascript as:

<button onClick=“javascript:changeBGC(‘blue’)”>Blå</button>
<button onClick=“javascript:changeBGC(‘white’)”>Hvit</button>
<button onClick=“javascript:changeBGC(‘black’)”>Svart</button>
<button onclick=“javascript:changeTextColor(‘black’)”>Svart</button>
<button onclick=“javascript:changeTextColor(‘white’)”>Hvit</button>
<button onclick=“javascript:changeTextColor(‘yellow’)”>Gul</button>

I’m a newbie to both javascript and jquery, but I’d like to solve this color selecting by a color picker like the spectrum color picker:

Can anyone help with this one?

Hi pmonstad,

Welcome to the forums!

I’m not too sure what you’re trying to accomplish here.
Could you go into a little more detail?

From what you posted, it seems like you have several buttons which change the background and text colour when you press one.
You don’t really need a colour picker for that.

Here is an example of a simple style changer I made for someone else.
Does that help you any?

Thanks, I guess this could help me. A question about your script. I see it includes some cookies. I have not gone deep into understanding your code, but what do the cookies do?

These ensure that the style changes persist between pages (a style switcher wouldn’t be much use if you had to reselect your styles every time you moved from one page to the next :)).
If you are interested I wrote all of this up as a blog post.