title: What is the shortest way to use a data-attribute as a selector?
body: <p>I must write a script which uses a lot of data-attributes.</p>
  <pre><code>&lt;span data-myval=&quot;123&quot;&gt;something&lt;/span&gt;
  </code></pre>
  <p>Normally I use the data-attribute in this way as a selector.</p>
  <pre><code>$('[data-myval=&quot;123&quot;]').dosomething
  </code></pre>
  <p>with a another variable which contains the data-myval-id I do it in this way</p>
  <pre><code>$('[data-myval=&quot;'+$(this).attr('data-myval')+']').dosomething
  </code></pre>
  <p>Now I look around but find no final answer if there is a way, to use the data-attribute in a shorter way as a selector?</p>