title: how to check for HTML tags and then add error in jQuery Validation
body: <p>I am trying to validate my form using jQuery Validation plugin.</p>
  
  <p>Here is the code</p>
  
  <pre><code>    $(document).ready(function(){
          var productsForm=$('#products-form');
       productsForm.validate({
              //debug:true,
            invalidHandler: function(event, validator) {
      // 'this' refers to the form
      var errors = validator.numberOfInvalids();
      if (errors) {
      var message = errors == 1
      ? 'You missed 1 field. It has been highlighted'
      : 'You missed ' + errors + ' fields. They have been highlighted';
      $("div.error span").html(message);
      $("div.error").show();
      } else {
      $("div.error").hide();
      }
      },
           rules:{
               productName: {
                   required: true,
                   minlength:2,
  
  //here i tried to create a function
  
                   onfocusout: function(element){
                   var myValue=$(element).val();
                   if(myValue.match(/[&lt;&gt;$]/))
                   {
                       alert('Please enter the Name without any tags.');
                       $(element).valid=false;
                   }
               }
               },
               productType: {
                   required: true,
                   minlength:2,
  
               },
               productBrand: {
                   required: true,
                   minlength:2,
  
               },
               description: {
                   required: true,
                   minlength:10,
                   maxlength:150,
  
               },
               updatedBy:{
                   required:true,
                   minlength:2,
               }
           },
           messages:{
               productName:{
                   required: "Please enter the productName",
                   minLength: "The name should be atleast 2 characters long",
               },
               productType: {
                   required: "Please enter the productType",
                   minlength:"The type should be atleast 2 characters long",
  
               },
               productBrand: {
                   required: "Please enter the productBrand",
                   minlength:"The Brand Name should be atleast 2 characters long",
  
               },
               description: {
                   required: "Please describe your product",
                   minlength: "The description should be atleast 10 characters long",
                   maxlength: "You can not enter more than 150 characters",
  
               },
               updatedBy:{
                   required: "PLease Your name",
                   minlength: "The name should be atleast 2 characters long",
               }
           },
           submitHandler: function(form){
               if(productsForm.valid())
               {
  
                  alert('tada');
                   return false;
               }
               else
               {
                   alert('not valid');
                   return false;
               }
           }
       });   
      });
  </code></pre>
  
  <p>Now I am trying to create a function which checks <strong>whether the input values contain HTML tags or not</strong>.  If yes then show the error msg and do not submit the form. But I do not know how to do that. Can anyone help please?</p>
  
  <p>I tried to create a function as <code>onfocusout</code> but <strong>do not know how to add error.</strong> </p>