jQuery get element ids list using jQuery.map()

Sam Deering

This is a quick example use of the jQuery .map() function. Say for instance you wanted to get a comma-separated list of all checkbox IDs in a form, you can do this! Check out the quick demo at https://jsfiddle.net/CEcgL/.

$(':checkbox').map(function() {
  return this.id;

Official jQuery.map() Doco