title: passing variable from data-attribute to onclick function
body: <p>I have a page with table of a number of records in it</p>
  
  <p>Each row has button on it I want to add an onclick event so it fires a popup message, if they ok it the page diverts to another page passing the value found in the data attribute but I cant get it to work</p>
  
  <p>Jquery looks like this:</p>
  
  <pre><code>            var aFeatures = document.querySelectorAll(".sweet-roll");
          for (var i = 0; i &lt; aFeatures.length; i++) {
                     aFeatures[i].onclick = function() {
                         swal({
                             title: "Rollback To Selected Version?",
                             text: "Are you sure you want to rollback to the selected version?",
                             type: "warning",
                             showCancelButton: true,
                             confirmButtonClass:  'btn-danger',
                             confirmButtonText:  'Yes, Rollback',
                             closeOnConfirm: false,
                             //closeOnCancel: false
                         },
                         function(){
                             window.location.href="/cms/rollback.aspx?id="+$(this).data('uuid');
                         });
                     };
                 }
             };
  </code></pre>
  
  <p>So that every button with the class 'sweet-roll' gets the onclick event.</p>
  
  <p>Each html row looks like this:</p>
  
  <pre><code>&lt;a class="btn btn-app sweet-roll" data-uuid="97aaa88c-ac9f-11e4-807b-0026b9ba6b95"&gt;&lt;i class="fa fa-reply-all"&gt;&lt;/i&gt;Rollback&lt;/a&gt;
  </code></pre>
  
  <p>But it keeps saying the value is undefined as if it cant find the data-uuid value?</p>