Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <table>
    <tr>
      <th>Nama</th>
      <th>Create</th>
      <th>Read</th>
      <th>Update</th>
      <th>Delete</th>
    </tr>
    <tr>
      <td>coba</td>
      <td><input type="checkbox" data-id="1" data-tipe="create"></td>
      <td><input type="checkbox" data-id="1" data-tipe="read"></td>
      <td><input type="checkbox" data-id="1" data-tipe="update"></td>
      <td><input type="checkbox" data-id="1" data-tipe="delete"></td>
    </tr>
    <tr>
      <td>coba 2</td>
      <td><input type="checkbox" data-id="2" data-tipe="create"></td>
      <td><input type="checkbox" data-id="2" data-tipe="read"></td>
      <td><input type="checkbox" data-id="2" data-tipe="update"></td>
      <td><input type="checkbox" data-id="2" data-tipe="delete"></td>
    </tr>
    <tr>
      <td><input type="button" id="btnUpdate" value="Update"/>
    </tr>
  </table>
  <textarea name="status" id="status" cols="30" rows="10"></textarea>
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script>
    $(function(){
      $('#btnUpdate').click(function(){
        var cb = [];
        $.each($('input[type=checkbox]:checked'), function(){
          cb.push($(this).data('id') + ' -> ' +$(this).data('tipe'));
        });
        $('#status').val(cb.join("\n"));
      })
    });
  </script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers