jQuery make DRY two almost identical on click function Is there a simple way to DRY this jQuery code?

  $('ul.icons li.size').click(function() {
    $('ul.icons li.size').not(this).removeClass('selected');
    $(this).toggleClass('selected');
  });

  $('ul.icons li.color').click(function() {
    $('ul.icons li.color').not(this).removeClass('selected');
    $(this).toggleClass('selected');
  });
You need to have a group selector and just use this context to have the clicked list element:    

  $('ul.icons li.size, ul.icons li.color').click(function() {
      $(this).addClass('selected')      // add to clicked li
             .siblings('li')           // get all other lis
             .removeClass('selected');  // remove the class
   });