title: Trying to get a value from a button using javascript
body: <p>So I have multiple delete buttons on a table and each button has there own unique id. I am trying to get this value via javascript but I can't get it to work at all.</p>
  
  <p>Here is a section js that is working properly and loads the correct html (this is ran for each movie): </p>
  
  <pre><code>function createRow(movie) {
          movie.NewDate = new Date(movie.ReleaseDate);
          return '&lt;tr&gt;&lt;td&gt;&lt;img class="movieImage" src="' +
              movie.ImageLink +
              '" alt="' +
              movie.Title +
              ' Image" style="width:50px;height:75px"&gt;' +
              '&lt;td&gt;' +
              movie.Title +
              '&lt;/td&gt;&lt;td&gt;' +
              movie.NewDate.toLocaleDateString("en-US") +
              '&lt;/td&gt;&lt;td&gt;&lt;button type="button" class="removeButton" value="' + movie.DVDID + '"&gt;Delete&lt;/button&gt;&lt;/td&gt;&lt;/tr&gt;';
      }
  </code></pre>
  
  <p>And here is the js where I am trying to retrieve the id:</p>
  
  <pre><code>$(document)
  .ready(function () {
      var deleteButtons = $(".removeButton");
      deleteButtons.each(function (index) {
          var currentButton = $(this);
          var buttonValue = currentButton.val();
          currentButton.click(function () {
              alert(buttonValue);
          });
      });
  });
  </code></pre>
  
  <p>I found the last snippet via <a href="https://stackoverflow.com/questions/9115942/click-one-of-multiple-buttons-put-value-in-text-input">Click one of multiple buttons, put value in text input</a></p>
  
  <p>Right now just getting a proper alert would be sufficient.</p>