mercredi 6 décembre 2017

Check if Dynamically Created Checkbox is checked or not?

I have a table with 16 rows and each row contains checkbox. I need to check if checkbox is checked or not. If check then do something otherwise do something else. I am trying but logic not working:

BtnGet is a button in each row. I am firing event on BtnGet:

$('.btnGet').each(function (i, obj) {
   if ($(obj)
      .closest("tr")
      .children("td:nth-child(3)")
      .find("input[type = checkbox]")
      .checked) 
      {
          console.log("Working");
       }
}




Aucun commentaire:

Enregistrer un commentaire