title: I cannot set data attribute of button
body: <p>I want to set the value of a data attribute in a button but somehow it doesn't work.</p>
  
  <p>JSFiddle:
  <a href="http://jsfiddle.net/4gwAS/1/" rel="nofollow">http://jsfiddle.net/4gwAS/1/</a></p>
  
  <p>My code:</p>
  
  <pre><code>    &lt;div id="parent"&gt;
  
      &lt;div id="rating" data-score="5"&gt;5 STARS&lt;/div&gt;
      &lt;button id="store_score"&gt;store rating in save button&lt;/button&gt;
  
      &lt;a href="javascript:void(0)" class="button save_rating"
                      data-score=""
                      data-organisor_id="12"
                      data-event_id="23"&gt;save rating&lt;/a&gt;
  
      &lt;/div&gt;
  
  $('#store_score').on('click', function() {
          var score = $('#rating').data('score'); //getter
          alert(score);
          $(this).parent().find('.save_rating').data('score', score);
  
      });
  </code></pre>
  
  <p>I need to address the class of the save button and cannot work with an id here.</p>
  
  <p>Any idea why the data-score attribute of the "save rating"-button does not get set?</p>