title: Javascript add/remove attribute for data-required="true"
body: <p><strong>HTML</strong></p>
  
  <pre><code>&lt;select name="CustomerType" id="CustomerType" class="form-control" onchange="CustomerTypeChange()"&gt;
      &lt;option value="@((int)THOS.Utilities.Enumerations.Enumerations.Customer.CustomerType.Company)" selected="@(Model != null ? (Model.CustomerType == (int)THOS.Utilities.Enumerations.Enumerations.Customer.CustomerType.Company):true)"&gt;Company&lt;/option&gt;
      &lt;option value="@((int)THOS.Utilities.Enumerations.Enumerations.Customer.CustomerType.Person)" selected="@(Model != null ? ((Model.CustomerType == (int)THOS.Utilities.Enumerations.Enumerations.Customer.CustomerType.Person)) : false)"&gt;Person&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;input type="text" name="TaxNumber" id="TaxNumber" class="form-control parsley-validated"&gt;
  </code></pre>
  
  <p>When CustomerType change below js code runs</p>
  
  <p><strong>Javascript Code:</strong></p>
  
  <pre><code>function CustomerTypeChange() {
      var customerType = document.getElementById("CustomerType").value;
      if (customerType == 10) {
          $('#TaxNumber').attr("data-required", 'false');
      }
      if (customerType == 20) {
          $("#TaxNumber").attr("data-required", 'true');
      }
  }
  </code></pre>
  
  <p>When i add TaxNumber attribute true/false <strong>attr("data-required", true)</strong> or  <strong>attr("data-required", false)</strong> never works . </p>
  
  <p><strong>Edited:</strong></p>
  
  <pre><code> $("#TaxNumber").data('data-required', true); does not work too
  
   $("#TaxNumber").data('required', true); does not work too
  </code></pre>
  
  <p>If i check browser console there is no any error where i miss exactly ?</p>
  
  <p>Thanks.</p>