mercredi 8 mars 2017

Check if checkbox is checked inside table td

I am trying to build a script which checks if a checkbox is checked using jQuery $each function.Below is the HTML code:

 <tr>
  <td class="categories">World</td>
  <td class="category_enabled" style="float: right;">
  <input type="checkbox"/>
  </td>
 </tr>

 <tr>
  <td class="categories">Economy</td>
  <td class="category_enabled" style="float: right;">
  <input type="checkbox"/>
  </td>                            
 </tr>

 <tr>
   <td class="categories">Ψυχαγωγία</td>
   <td class="category_enabled" style="float: right;">
   <input type="checkbox"/>
   </td>
 </tr>

I believe it is something like (inside .each()):

if ($("find_specific_checkbox").is(":checked")){
   console.log("Checked!");
}

Any ideas how I can do this. I am trying a couple of hours but nothing yet.




Aucun commentaire:

Enregistrer un commentaire