This is doing my head in, I have googled the life out of it, but below is my code, very simple, but I do not get the click event triggered when unchecking a checkbox??
$('#filterStarDiv #hotelFilterForm #Star0').click( function() {
alert('Checkbox 0 clicked');});
<div id="starsRemoved" style="display:none">No Stars Removed</div>
<div id="filterStarDiv">
<h6>Click on the star ratings below to add or remove hotels in that category</h6>
<form:form id="hotelFilterForm" action="" acceptCharset="UTF-8">
<input type="checkbox" id="Star0" name="Star0" value="0 Star" checked="checked" /> 0 Star<br />
<input type="checkbox" id="Star1" name="Star1" value="1 Star" checked="checked" /> 1 Star<br />
<input type="checkbox" id="Star2" name="Star2" value="2 Star" checked="checked" /> 2 Star<br />
<input type="checkbox" id="Star3" name="Star3" value="3 Star" checked="checked" /> 3 Star<br />
<input type="checkbox" id="Star4" name="Star4" value="4 Star" checked="checked" /> 4 Star<br />
<input type="checkbox" id="Star5" name="Star5" value="5 Star" checked="checked" /> 5 Star+<br />
</form:form>
</div>
Any help, even abuse if I am missing something stupid, would be appreciated.
#filterStarDiv #hotelFilterForm #Star0. Just#Star0will be enough.<form:formand</form:form>? Also input elements in a form need to be put inside a<div>or a<p>. You can't put them directly inside the<form>tag.