checkbox toggle (mobile)
checkbox toggle (mobile)
I'm trying to trigger a toggle event from a checkbox using jQuery mobile. Here's a simple version of the html:
<input type="checkbox" name="someName" id="someName" checked="checked" />
<label for="someName">Some Named Label</label>
<div class="hiddenByDefault">
-- content that's hidden by default and displayed when the checkbox is unchecked --
</div>
Here's the JS in it's simplest form (not working):
$(".hiddenByDefault").hide();
$("[name=someName]").change(function () {
$(".hiddenByDefault").toggle();
});
When using the default checkbox styling in JQMobile, a bunch of style elements are added and it appears the default functionality of the checkbox is lost. Does anyone know how to work around this? I'd like to use the checkbox style and trigger the toggle when a user interacts with it.