title: Update value on success(using raty and bootstrap popover)
body: <p>I am using bootstrap <code>popover</code> with <code>jquery-raty</code>. I have <code>hidden</code> div showing them on popover with JS function <code>content:</code>. I want to update some attribute in hidden div.
  Suppose I've <code>data-rating</code> attribute in hidden div.  I want to update <code>data-rating</code> value. I am using following statement. </p>
  
  <pre><code>('#hidden_div_1`).data('rating', '25');
  </code></pre>
  
  <p>When I print data attribute <code>console.log($('#hidden_div_1').data('rating'));</code> I get <code>25</code> which is correct. But when I hover again on particular object to display the popover I get <code>old</code> attribue values. Value is <code>destroying when popover disappeared</code>. I don't know why. Any anyone help?</p>
  
  <p>This is my <a href="http://dpaste.org/eqLv9/" rel="nofollow noreferrer">full jquery code</a>.
  This is small <a href="http://jsfiddle.net/KZBW6/4/" rel="nofollow noreferrer">jsfiddle</a></p>
  
  <p>Thanks</p>
  
  <p>EDIT 1: <code>$('#hidden_div_1').data('rating', '25');</code></p>
  
  <p>EDIT 2: It is strange. <code>data-rating</code> value is  not changing. I've attached <code>console.log</code> output.</p>
  
  <p><img src="https://i.imgur.com/m7kGHGh.png" alt="Console.log"></p>
  
  <p>Code > </p>
  
  <pre><code>$('.link-container a').popover({
          content : function() { return $(this).siblings('.popover-content').html(); },
          trigger: 'click',
          html: true
      }).click(function(){
        $('.ratings').raty({
          score: function() { return $(this).attr('data-rating'); },
          click: function(score, evt, data) {
              //alert(score);
              var currentId = $(this).attr('id');
              console.log($("#"+currentId).data('rating'));
              alert(currentId);
              $("#"+currentId).attr('data-rating', score);
              console.log($("#"+currentId).data('rating'));
              $("#"+currentId).data('rating', score);
              console.log($("#"+currentId).data('rating'));
  
          },
            path: '/static/img/rating/',
        });
      });
  </code></pre>
  
  <p><code>alert(currentId);</code> printing <code>correct</code> id.</p>