title: Find element by matching attribute key instead of value
body: <p>With jQuery (or <code>document.querySelector()</code>), you can use the following to get elements by its attribute values:</p>
  
  <pre><code>//Exact value
  $("[attribute='value']");
  //Contains value
  $("[attribute*='value']");
  //Starts with
  $("[attribute^='value']");
  //Ends with
  $("[attribute$='value']");
  </code></pre>
  
  <p>But what I'm trying to achieve is a bit different.</p>
  
  <p>Suppose I have this element:</p>
  
  <pre><code>&lt;button ls-click="alert('a')"&gt;Click!&lt;/button&gt;
  </code></pre>
  
  <p>I need to get that one element because it has an attribute that starts with <code>ls-</code>.</p>
  
  <p>jQuery has the <a href="https://api.jquery.com/has-attribute-selector/" rel="nofollow noreferrer"><code>hasAttribute</code></a> selector that works like <code>$("[attr]")</code>, but it only matches elements with that exact attribute, no wildcards accepted.</p>
  
  <p>I could add a class to that button and check every attribute if anything matches with <code>ls-</code>, but that is counter intuitive to what I'm trying to achieve.</p>
  
  <p>I could also run trough every DOM element and check if any of them has that attribute (I guess that's what jQuery does anyways), but I think that's not the best solution.</p>
  
  <p>Is there a selector that does that? (If there is some way without jQuery, that'd be interesting to know, too).</p>