How to get the checkbox status and data value from my table in HTML? I want to get the @myJob.so_no.
Here's my view:
class="table table-striped table-hover table-condensed" id="myJobTable">
- class="thead-dark">
"col"># "col"> "col">Date "col">SO No "col">Serial "col">Status "col">Technician - @foreach (MyJobAllocation myJob in Model.MyJob)
- {
@myJob.row - "checkbox" id="chk" />
@myJob.date @myJob.so_no @myJob.serial @myJob.status @myJob.technician - }
- class="thead-dark">
I'm trying to print a simple alert if my function is working. But it doesn't.
- function asign_to() {
- var table = document.getElementById("myJobTable");
- var value_check = "";
- for (var i = 0; i < table.rows.length; i++) {
- if ($('#chk')[i].is(':checked')) {
- alert('You clicked me!');
- }
- }
- }
- TypeError: $(...)[i].is is not a function
Ramesh PalanivelPosted Nov 13, 2017, 5:40 AM
Bryan GomezPosted Nov 13, 2017, 8:15 AM