jquery - How to check all check boxes by checking one? -


i trying check check boxes when "selectall" check box selected

i have tried codes work still not working me.

when click on main check box nothing happens.

here have done far

<script>  $(document).ready(function() {     if(   $('#selectall').is(':checked')  ){          $.each($('input[name=activitie]'){             $('input[type=checkbox]').prop('checked', true)         }      } });  </script> 

shameless self-promotion: there's jquery plugin that. in case, think trick:

$(function () {     $('#selectall').checkall('input[type="checkbox"]'); }); 

without seeing markup, however, can't sure...


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -