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 PalanivelRank #372 · 6.8K reputationPosted Nov 13, 2017, 12:40 AM EST
Bryan Gomez19 reputationPosted Nov 13, 2017, 3:15 AM EST