title: Retrieve (and pass) the IDs of all elements of a certain class
body: <p>I'd like to retrieve (and be able to save/use) the IDs of all elements of a certain class in Javascript.</p>
  <p>If I wanted to select all <code>div</code> elements of class <code>myClass</code> then I believe I could do</p>
  <pre><code>$(document).ready(function() {
      $('div.myClass').click(function() {
          alert('this is a div of class myClass');
      });
  });
  </code></pre>
  <p>so I'm looking for something like</p>
  <pre><code>$(document).ready(function() {
      $('div.myClass').click(function() {
          let thisid = __selected__.attr('id');
          myFunc(thisid);
      });
  });
  </code></pre>
  <p>which invokes a function using the IDs associated with each element of class 'myClass'.</p>