Skip to content

Instantly share code, notes, and snippets.

@larssg
Created March 4, 2011 10:32
Show Gist options
  • Save larssg/854433 to your computer and use it in GitHub Desktop.
Save larssg/854433 to your computer and use it in GitHub Desktop.
Check all checkboxes containing a specific string in the id.
$('input[type=checkbox]').each(function() { var b = $(this); if(b.attr('id').indexOf('edit-facts') > -1) { b.attr('checked','checked') } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment