title: Jquery validation based on expando attributes
body: <p>I am trying to validate an input based on attributes (data-inStock) that this input has:</p>
  
  <p>HTML:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="number" name="stockQuantity" class="stockQuantity" data-inStock="5" /&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>jQuery.validator.addClassRules("stockQuantity", {
              required: true,
              min: 0,
              max: **value in data-inStock attribute,**
          });</code></pre>
  </div>
  </div>
  </p>
  
  <p>So in this case how can i read the value "data-inStock" from inside the jquery validator?</p>