I have a <table> and some rows (varies depending on the query run ) where I can a radio button and some <th> and an <input> and I want to catch that <input> value for further processing so please guide me
my HTML code
<tr>
<th>
<input type="radio" name="assignRadio">
</th>
<th> <?= $nearestResponders[ $i ]->get('firstName') . " " . $nearestResponders[ $i ]->get('lastName'); ?></th>
<th> <?= $companyName; ?></th>
<th> <?= $nearestResponders[ $i ]->get('contactNumber'); ?></th>
<th> <?= $presentCity; ?></th>
<th><?= $distanceInKM; ?></th>
<input class="selectedResponder" type="hidden" value="<?= $nearestResponders[ $i ]->getObjectId(); ?>">
</tr>
</table>
my jQuery code
$('input[name=assignRadio]').on('change',function(){
console.log($(this).val());
console.log($(this).next('.selectedResponder').val());
console.log($(this).closest('.selectedResponder').val());
console.log($(this).find('.selectedResponder').val());
});
as you can see I tried some methods to get the value but failed so please advise