I have several input check boxes that share a class called checkboxJobSeekerProfile. I am trying to write an alert that prints how many of them are checked. For some the alert always show 0 even when several of the check boxes are checked. Here is my alert
alert($('.checkboxJobSeekerProfile input[type=checkbox]:checked').length);
Here is my html
<label class="checkbox-inline"><input type="checkbox" class="checkboxJobSeekerProfile entry_level"
id="entry_level" value="entry_level">Entry-level</label>
<label class="checkbox-inline"><input type="checkbox" class="checkboxJobSeekerProfile mid_level"
id="mid_level" value="mid_level">Mid-level</label>
<label class="checkbox-inline"><input type="checkbox" class="checkboxJobSeekerProfile senior_level"
id="senior_level" value="senior_level">Senior-level</label>
<label class="checkbox-inline"><input type="checkbox" class="checkboxJobSeekerProfile executive"
id="executive" value="executive">Executive</label>