title: How to find an element by data attribute with find() function?
body: <p><strong>I add a data attribute to an element via jquery <code>data()</code> function.</strong> </p>
  
  <p>I want to use find() function to get the element. But obviously, it does not work.</p>
  
  <p>What I want to do is caching the element's parent element and do a lot of things. </p>
  
  <p>Like this:</p>
  
  <pre><code>var $parent = $('#parent');
  var $dataElement = $parent.findByData('whatever');
  $parent.xxx().xxx().xxx()....;
  </code></pre>
  
  <p>I don't want this:</p>
  
  <pre><code>var $parent = $('#parent');
  var $dataElement = $("#parent [data-whatever='whatever']");
  $parent.xxx().xxx().xxx()....;
  //It looks like find the parent twice.
  </code></pre>
  
  <p>Can any function do this?</p>