title: checking if data-val-required exist
body: <p>inside js script I'm trying to recognize if data-val-required exist on certain element.</p>
  
  <pre><code>var attrExist = $('#myElem').find('[data-val-required]');
      if (attrExist.length &gt; 0){
              // todo
      }
  </code></pre>
  
  <p>but this doesn't work, cause I'm getting always inside console attrExist as Object[].</p>
  
  <p>How can test if data-val-required attr exist?</p>
  
  <p>update:
  rendered html looks like </p>
  
  <pre><code>&lt;select id="myElem" class="multiselect form-control" name="someName"
           multiple="multiple" data-val-required="This field is required." 
           data-val="true" style="display: none;"&gt;
  </code></pre>