Try: $("#mfglist input:checkbox") or maybe: $("#mfglist :checkbox") (note the space before :) might work.
Using: $('#manufacturers:checkbox') is saying that you have a checkbox with the ID of manufacturers, which is incorrect. On Feb 5, 11:09 am, sdeo <deo.shant...@gmail.com> wrote: > Hi > I have the following html where I have a bunch of checkboxes which I > want to trigger events when checked/unchecked. But apparently the > events are not being recognized. > > I have tried using various ways to access the checkboxes, but nothing > seems to work. > 1) $('#manufacturers:checkbox').click(function(){ > 2) $("#mfglist:checkbox").click(function(){ > > Being new to JQuery, I did try reading all the blogs/tutorials, but no > luck so far. Any help is really appreciated. > > Thanks! > sdeo > > BEGIN HTML SNIPPET > > <div id="manufacturers"> > <h3><a href="#">Manufacturers</a></h3> > <div> > <form id="mfgform" name="mfgform" method="post" action=""> > <ul id="mfglist"> > <label><input name="mfg" id="mfg" value="Apple (10)" > type="checkbox">Apple (10)</label><br> > <label><input name="mfg" id="mfg" value="Nokia (30)" > type="checkbox">Nokia (30)</label><br> > <label><input name="mfg" id="mfg" value="Motorola > (8)" type="checkbox">Motorola (8)</label><br> > <label><input name="mfg" id="mfg" value="Samsung > (5)" type="checkbox">Samsung (5)</label><br> > </ul> > </form> > </div> > </div> > > JS file: > > function selectMfgEvent(){ > console.log("begin selectMfgEvent"); > $('input[type="checkbox"]').click(function(){ > if($(this).is(":checked")){ > console.log("checked = "+this); > } > > }); > > $(document).load(selectMfgEvent()); > > }; > >