jquery change div background image click
<p>Hi i don't know how to change a div background image so here is the how it should work</p>

<p>I have some images with an onclick="change_color()" and some divs also with an onclick="get_color()", what i want is when i click the image i should get the image src and then after i click on the div that div will get the background image from the prev clicked image.</p>

<p>all i've managed to do is to get the image src </p>

<pre><code>$(document).click(function(e) {
   e = e || event;
   $.lastClicked = e.target || e.srcElement;
   $.lastClicked2 = e.target || e.srcElement;
  });

function change_color()
{
var lastClickedElement = $.lastClicked;
lastClickedElement.getAttribute('data-color');
}
</code></pre>

<p>Please help me.</p>
