title: Is there an API for jQuery unobtrusive validation?
body: <p>I have this validation summary in my code:</p>
  
  <pre><code>@Html.ValidationSummary(false, "Fix Error", new { id = "valSumId" } )
  </code></pre>
  
  <p>Is there an API so I can add validation error during runtime? Though the following code works, it feels brittle, there's nothing to stop ASP.NET MVC team from not using ul li tags for displaying errors on the next ASP.NET MVC release.</p>
  
  <pre><code>$('input[type=submit]').click(function (e) {
      e.preventDefault();
      if ($('form').valid()) {
          /* ajax submit here */
  
          if (anErrorOccured) {
              $('#valSumId').removeClass().addClass('validation-summary-errors');
              errorList = $('#valSumId &gt; ul');
  
                      // the message is variable, coming from JSON, and can be a list
              errorList.append($('&lt;li /&gt;').text('Your ordered quantity is above the stock level'));
          }
      }
  });
  </code></pre>