Skip to content

Instantly share code, notes, and snippets.

@czottmann
Forked from anonymous/snippet.js
Created April 6, 2011 22:40
Show Gist options
  • Save czottmann/906697 to your computer and use it in GitHub Desktop.
Save czottmann/906697 to your computer and use it in GitHub Desktop.
// ossum radio buttons!
$('label:has(input:checked)').addClass('checked');
$('.input.radio label').click(function () {
$(this).siblings('label').removeClass('checked');
$(this).addClass('checked');
});
// besser:
$("form input:radio")
.click( function(evt) {
$(this).closest("label:has(:checked)").addClass("checked").siblings("label").removeClass("checked");
})
.parent().find("input:radio:checked").click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment