this is my code in `index.blade.php`

1. HTML

```
@foreach($sesis as $sesi)
<td>{{ $sesi->waktu }}
     <label class="switch switch-text switch-info switch-pill" id="label-switch{{ $sesi->id }}">
         <input type="checkbox" id="switch-sesi{{ $sesi->id }}" name="status" value="{{ $sesi->id }}" class="switch-input">
         <span data-on="Ada!" data-off="Absen" class="switch-label"></span>
         <span class="switch-handle"></span>
     </label>
</td>
@endforeach

```

2. jquery

```
@foreach($sesis as $sesi)
    $('#switch-sesi{{ $sesi->id }}').on('change', function(){
        if($(this).is(":checked")){
            console.log($(this).val());
        }else{
            console.log('tidak checked');
        }
    });
@endforeach

```

there is no problem with my code, but it looks like my code not efficient (see my jquery code). I'm trying to get id attributes from the input type checkbox with looping all the block code. I'm just wondering, is there anyway to efficient it ?