Fetch certain checkbox values and put them in an array.

Fetch certain checkbox values and put them in an array.

I use the following code to store all checked checkbox values into a variable:

  1. $("#myBtn").click(function () {
  2.    
  3.     var searchIDs = $('input:checked').map(function(){
  4.         
  5.       return $(this).val();
  6.         
  7.     });
  8. $(".gathering").val(searchIDs.get());


  9. });

It works, but this code gathers ALL the values of  checked checkboxes.
How can I adjust the coding so that only the checkboxes with a certain class in it are 'gathered' ?

For example: I only want to store the values with the class ' myCheckBox' into the variable
  1. <input type="checkbox" class='myCheckBox' value="11">
  2. <input type="checkbox" class='not this one' value="31">
  3. <input type="checkbox" class='myCheckBox' value="44">