Who do I get jquery to show the new value of a variable

Who do I get jquery to show the new value of a variable

Jquery noob here. I have a table in which each row has a View button. I store the variable that holds the record's id in a data-whatever tag
  1. <button><a id="buttone" type="submit" class="btn btn-small" data-whatever="<?php echo $eventID ;?>">View</a></button>
I have a div that i want to load details of the selected record for, beneath the table. When I click the button I pass the id to a php page that displays in the div on the same page. 

The problem is jquery is only storing the variabe for the first record in the table so i can only load the details of the first record no matter which one i click. I have searched but I am not exactly sure whats applicable in my case, below is what I have tried. Thanks for your help.

  1. $(document).ready(function(){
  2.     $('#form').submit(function(){
  3.   $('#insertResult').empty();

  4.   //var id = null;
  5.   //$ ("#buttone").removeAttr('data-whatever');
  6.   //$("#buttone").removeData('whatever');
  7.   //var id = $( "#buttone" ).attr('data-whatever');
  8.         //var id = $("#eventID").val();
  9.         var dataString = "id=" + id
  10.       
  11.   $.ajax({
  12.                 type: "GET",
  13.                 url: "readnote.php",
  14.                 data: dataString,
  15.                 cache: false,
  16.                 success: function (data) {
  17.                  
  18.                    $('#insertResult').html(data);
  19.                 },
  20.                 error: function(err) {
  21.                     console.log(err);
  22.                 }
  23.             });  
  24.            return false;  
  25.     });

  26. });