title: How do I use jQuery to return the current state of my div?
body: <pre><code>var div = document.querySelector('#myDiv')
  div.dataset.color = 0;
  div.addEventListener('click',()=&gt;{
  div.dataset.color = parseInt(div.dataset.color)+10;
  var c = (div.dataset.color%256)*100;
  div.style.background = 'rgb(0,'+c+',0)';
  });
  
  #myDiv {
  width: 200px;
  height: 200px;
  background: #000000;
  }
  
  &lt;div id="myDiv"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>If I am using this code for individuals to choose a color, how do I use jquery to return the current state of the color picker? Meaning, if a person was clicking through until they found the color they wanted, what can i do to log the selection that they decide on? Is there a button I can use to select the color and then output that selection into an excel file?</p>