Color choosing

Color choosing


I want to create a color picker so that when I click on 'color' div (at the end of this script) then the 'test' div becomes that color.

I'm really new to jquery - could someone please point me in the right direction for this?

Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jquery fun</title>
.test {
    background-color:#FF0; width:60px; height:60px;

.color {
    width:20px; height:20px; padding:10px; margin: 10px;

<script src=""></script>


<div class="test"></div>

<div class="color" style="background-color:#F00;"></div>
<div class="color" style="background-color:#FF0;"></div>
<div class="color" style="background-color:#F0F;"></div>

$(".test").click(function () {

$(".color").click(function () {