Q:

jQuery Get Input Name Array Key Value from Neighbouring TD

Hard one to explain in the title, but a bit of code says it all:
<tr class="">
  <td>
    <input value="9" name="set[122][order]"></input>
    <input class="set-id" type="hidden" value="1" name="set[122][ex_id]"></input>
  </td>
  <td>
    <input value="0.00" name="set[122][weight]"></input>
  </td>
  <td> … </td>
  <td>
    <img class="deleteRowButton" border="0" title="Toggle Delete Set" alt="Delete Set" src="mysite/images/icons/png/delete-3x.png"></img>
  </td>
</tr>

I have a bit of jQuery code that is activated when the img (deleteRowButton) is clicked:
$('.deleteRowButton').click (function() {

  $(this).parents("tr").toggleClass( "deleteSet" );
  var id = $('.set-id', $(this).closest('td')).val(); // this bit not working

  $('.editWoForm').append('<input type="hidden" name="deleteSet[]" value="' + id + '" />');
});

The deleteRowButton code basically just inserts a hidden input tag at the bottom of my form, so i have the ability to process these to remove entries from db.
BUT, what I need to do is grab the value from set[], so in this example 122. It can come from any of the inputs, as the whole tr is related to one entry. 122 is the db id, so that's what I need to grab.
So ideally, when the user clicks on the deleteRowButton, it generates and inserts:
<input type="hidden" name="deleteSet[]" value="122" />

Thanks in advance!

Solution
Thanks to @ArunPJohny for the assistance.
$('.deleteRowButton').click (function() {
  var $tr = $(this).parents("tr").toggleClass( "deleteSet" );
  var id = $tr.find('.set-id').attr('name').match(/\d+/)[0];

  if($tr.hasClass( "deleteSet" )){
    $('.editWoForm').append('<input type="hidden" name="deleteSet[]" value="' + id + '" />');
  }
  else{
    $('input[name="deleteSet[]"][value="' + id + '"]').remove();
  }
});

This will get the id, append a hidden input field with said id as the value, then if the button is pressed again (to toggle the delete state) the hidden input field is removed.

A:

One way here is to fine the set-id element which is within the current tr element. what you are trying to do is to find an set-id which is within the td which contains the clicked deleteRowButton.

$('.deleteRowButton').click(function() {

  //use closest instead of parents
  var $tr = $(this).closest("tr").toggleClass("deleteSet");
  //find the set-id within the current tr
  var id = $tr.find('.set-id').attr('name').match(/\d+/)[0];
  //$('.editWoForm').append('<input type="hidden" name="deleteSet[]" value="' + id + '" />');
  $('#log').text(id)
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<table>
  <tr class="">
    <td>
      <input value="9" name="set[122][order]"/>
      <input class="set-id" type="hidden" value="1" name="set[122][ex_id]"/>
    </td>
    <td>
      <input value="0.00" name="set[122][weight]"/>
    </td>
    <td> … </td>
    <td>
      <img class="deleteRowButton" border="0" title="Toggle Delete Set" alt="Delete Set" src="mysite/images/icons/png/delete-3x.png"/>
    </td>
  </tr>
  <tr class="">
    <td>
      <input value="9" name="set[123][order]"/>
      <input class="set-id" type="hidden" value="2" name="set[123][ex_id]"/>
    </td>
    <td>
      <input value="0.00" name="set[123][weight]"/>
    </td>
    <td> … </td>
    <td>
      <img class="deleteRowButton" border="0" title="Toggle Delete Set" alt="Delete Set" src="mysite/images/icons/png/delete-3x.png"/>
    </td>
  </tr>
</table>
<div id="log"></div>

