samedi 28 février 2015

How do I detect when a checkbox is ticked or unticked? jquery/ajax

What is the conventional way of detecting when a simple input checkbox is ticked or unticked with jquery?... im playing around with selectors and "clicked, changed, live" functions but just cant get any reaction from the event handler..


This is the input im using:



<input type='checkbox' name='checkbox1' /> <div id='darren123'>...</div>


This is what im currently testing, ive tried lots of variations of this code but this is jut the latest JS ive tried to use:



$('input:checkbox[name=checkbox1]').click(function() {
$('div#darren123').text("testSuccess!");
});


I can get this to work when i use a hyperlink tag... any ideas why i cant get a reaction from this checkbox~?





Aucun commentaire:

Enregistrer un commentaire