Here is some basic HTML code:
<div class="stuff-choice">
<div class="item a">
<label class="signup-checkbox">
<input type="checkbox" value="a" name="stuff[a][]" id="stuff_choice_" class="things">
<strong>A</strong>
</label>
</div>
</div>
In this code, I have set up functionality where clicking on a checkbox with the CSS class .things
will update the parent <div>
with the CSS class .selected
.
The JavaScript code for this feature:
$('.things').click(function() {
item = $(this).closest("div");
if ($(this).attr('checked') != null)
$(item).addClass('selected');
else
$(item).removeClass('selected');
});
This code works perfectly in Safari (mac & win) and Firefox (mac & win), but encounters issues in Internet Explorer.
If anyone has insights on why it may not work in IE, please let me know.
Thank you,
Alex