title: How access element attribute inside Parsley Validation
body: <p>I need get attributes of element inside Parsley validation, I can using jQuery and selector, but I think it not the best way, have another way to do it?</p>
  
  <p>See below my validation and html code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>(function () {
    'use strict';
  
    // Validate xml extension.
    window.ParsleyValidator.addValidator('filetype',
        function (value, requirement) {
          var ext = value.split('.').pop().toLowerCase();
  
          return ext === requirement;
        }, 32)
      .addMessage('en', 'filetype', 'The selected file must be an %s file.');
  }());</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/&gt;
  
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://cdn.bootcss.com/parsley.js/2.0.7/parsley.js"&gt;&lt;/script&gt;
  
  &lt;div class="container"&gt;
    &lt;form class="form-horizontal" role="form" data-parsley-validate&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="file" class="col-sm-2 control-label"&gt;File&lt;/label&gt;
        &lt;div class="col-sm-4"&gt;
          &lt;input type="file"
            name="file[]"
            id="file"
            class="form-control"
            multiple="multiple"
            data-buttonText="Escolha arquivo"
            data-iconName="fa fa-folder-open"
            data-parsley-filetype="xml"
            required&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;div class="col-sm-10 col-sm-offset-2"&gt;
          &lt;button type="submit" class="btn btn-default"&gt;Salvar&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>