title: Pass data attribute to a function
body: <p>I have many div elements with same class name and different data-value attribute. When click over one div i want to pass its data-attribute to a function  and do some stuff depending on data-value attribute. How can i achieve that?</p>
  
  <pre><code>&lt;div class="voto" data-value="1" onclick="VotaUtente.AggiungiVoto();"&gt;
      &lt;img src="img/stella-1.png"&gt;
      &lt;img src="img/stella-0.png"&gt;
      &lt;img src="img/stella-0.png"&gt;
      &lt;img src="img/stella-0.png"&gt;
  &lt;/div&gt;
  &lt;div class="voto" data-value="2" onclick="VotaUtente.AggiungiVoto();"&gt;
      &lt;img src="img/stella-1.png"&gt;
      &lt;img src="img/stella-1.png"&gt;
      &lt;img src="img/stella-0.png"&gt;
      &lt;img src="img/stella-0.png"&gt;
  &lt;/div&gt;
  &lt;div class="voto" data-value="3" onclick="VotaUtente.AggiungiVoto();"&gt;
      &lt;img src="img/stella-1.png"&gt;
      &lt;img src="img/stella-1.png"&gt;
      &lt;img src="img/stella-1.png"&gt;
      &lt;img src="img/stella-0.png"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JQuery</p>
  
  <pre><code>AggiungiVoto: function ()
      {
          $(".voto").click(function (e) {
              e.preventDefault();
              var nVote = $(e.currentTarget).data("value");
              console.log("nVote " + nVote);
          });
      },
  </code></pre>
  
  <p>I know that i can retrieve the data attribute using (".voto").data('value') but how can i pass the reference to the element i clicked to the function to determine the right value (ex. click on div with data-value="3" it returns 3) ?</p>
  
  <p>Thanks to all!</p>