I have a table with each row representing a member. I’m trying to figure out how to get the values (in comments below) from that row when the user selects from that rows drop down.
<tr class="success" id="1">
<th scope="row">
<i class="fa fa-user ready"></i>
</th>
<td class="name">Member Name</td>
<td>
<select class="changeStatus form-control input-sm">
<option>Ready</option>
<option>Ready</option>
<option>Enroute</option>
<option>If Absolutely Needed!</option>
<option>Out</option>
</select>
</td>
<td>
<a href="tel:555-555-5555">
<i class="fa fa-phone-square"></i>
Call
</a>
<a href="sms:555-555-5555">
<i class="fa fa-mobile"></i>
Text
</a>
</td>
</tr>
<tr class="success" id="2">
. . .
</tr>
<tr class="success" id="3">
. . .
</tr>
<script type="text/javascript">
$(document).ready(function() {
$('.changeStatus').change(function(){
var status = $(".changeStatus").val();
// how to get id of parent tr
// how to get value of that particular dropdown selected
// how to get the value of class name or any of the values inside of the parent tr
alert(status);
});
}); //ready(function
</script>
Thanks