JSFiddle - React, Tailwind, and code Playground

by Shree Khanal

HTML

<input type="button" value="Show selected" onclick="return false" class="showSelectedOnly">

<table>

<tr>
<td>
<input type="checkbox" class="order_row" data-order-id="20161004-135848" name="sel20161004-135848" ></td>
</tr>
<tr>
<td>
<input type="checkbox" class="order_row" data-order-id="20161004-135848" name="sel20161004-135848" ></td>
</tr>

<tr>
<td>
<input type="checkbox" class="order_row" data-order-id="20161004-135848" name="sel20161004-135848" ></td>
</tr>

</table>

JavaScript

$(".showSelectedOnly").click(function(){

    $('.order_row:checkbox:checked').each(function () {
      var sThisVal = $(this).attr("data-order-id");
      alert(sThisVal);
    });
  });