title: How can I get data from multiple attributes?
body: <p>I want to get data from multiple attributes on click event. Suppose I have a div with class <code>test_class</code> and ID <code>testID</code> as given below. </p>
  
  <pre><code>&lt;div class="test_class" id="testId"&gt;&lt;!-- ... --&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I want to get the value of the <code>class</code> and <code>id</code> attributes and store them in separate variables.</p>
  
  <pre><code>var classattr = 'test_class';
  var idattr = 'testId';
  </code></pre>
  
  <p>How can I make this? I would like to avoid calling <a href="https://api.jquery.com/attr/" rel="nofollow noreferrer"><code>attr()</code></a> multiple times.</p>