title: How to select an HTML element using jQuery or JavaScript and the element's name attribute
body: <p>How (can one?) can I open a modal using jQuery or JavaScript, using the HTML element's <strong>name attribute</strong> <code>value</code>, instead of using the modal <code>id</code>? (I have the same modal <code>id</code> so I don't have to duplicating my css)</p>
  
  <p><strong>I was thinking something like this would do the trick:</strong></p>
  
  <pre><code>&lt;div id="product-description-modal" name="uop-modal" role="dialog" class="modal"&gt;&lt;/div&gt;
  &lt;div id="product-description-modal" name="payu-modal" role="dialog" class="modal"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>My jQuery method to open the specific modal:</strong></p>
  
  <pre><code>onShowModal() {
      if (this.showPayAsYouUseModal === true) {
        $('div[name]="payu-modal"').modal('show');
      } else {
        $('div[name]="uop-modal"').modal('show');
      }
  }
  </code></pre>
  
  <p>But I have had no luck so far. What am I missing?</p>
  
  <p>Thank you in advance!</p>