See this fiddle: http://jsfiddle.net/Bg9Zx/5/
Relevant code:
<fieldset data-role="controlgroup" data-type="horizontal" id="locate-me">
<input type="checkbox" name="loc" id="loc" />
<label for="loc">Locate me</label>
</fieldset>
$("#loc").click(function(){
alert('locate clicked!');
});
Why isn’t the .click() event firing? Works perfectly fine if I don’t reference jQuery Mobile.
Thanks!
You are referecing it wrong. #loc refers to an ID of an element use this instead.