title: Get the current input value with the same class names
body: <p>Im trying to alert the current value that is in the input box depending on which button you click on. So if the first grid-2 button is selected it would alert 1 and if the second button with the input value of 2 was to be clicked on instead it would alert that number etc.</p>
  
  <pre><code>&lt;div class='grid-2'&gt;
      &lt;input class="photo1" value="1"&gt;
      &lt;a class='remove-photo' href='#'&gt;Remove Now&lt;/a&gt;
  &lt;/div&gt;
  
  &lt;div class='grid-2'&gt;
      &lt;input class="photo1" value="2"&gt;
      &lt;a class='remove-photo' href='#'&gt;Remove Now&lt;/a&gt;
  &lt;/div&gt;
  
  
  &lt;div class='grid-2'&gt;
      &lt;input class="photo1" value="3"&gt;
      &lt;a class='remove-photo' href='#'&gt;Remove Now&lt;/a&gt;
  &lt;/div&gt;
  
  
  &lt;div class='grid-2'&gt;
      &lt;input class="photo1" value="4"&gt;
      &lt;a class='remove-photo' href='#'&gt;Remove Now&lt;/a&gt;
  &lt;/div&gt;
  
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $(".remove-photo").click(function() {
          var current_selected_photo_num = $(".photo1").val();
          alert(current_selected_photo_num);
      });
  }); 
  &lt;/script&gt;
  </code></pre>