title: Adding maxlenght to textbox
body: <p>Some value are returned to ajax from C#. I need to bind those values to GridView. Everything works ok but only difference is this value: <code>$("span", row).eq(4).attr("maxlength",this.MaxNoPlaces);</code> needs to be bind to <code>MaxLength</code> property of textbox instead of value. </p>
  
  <p>I also tried input instead of span and attr <code>maxlength</code> but it is not working. </p>
  
  <pre><code>$(document).on('click', ".myBtn", function() {
  
    header = $(this).closest('tr').find('.ObjekatID').text()
    console.log(header);
  
  
    $.ajax({
      type: "POST",
      url: "Administration.aspx/GetRequest",
      data: JSON.stringify({
        'header2': header2
      }),
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function(data) {
        var row = $("[id*=grdDemo] tr:last-child").clone(true);
        $("[id*=grdDemo] tr").not($("[id*=grdDemo] tr:first-child")).remove();
        //  alert($("[id*=grdDemo]").html());
        var count = 1;
        $.each(data.d, function() {
          $("span", row).eq(0).html(this.ObjectID);
          $("span", row).eq(1).html(this.ObjectName);
          $("span", row).eq(2).html(this.ObjectValue);
          $("span", row).eq(3).html(this.ObjectTypeID);
  
          $("span", row).eq(4).attr("maxlength", this.MaxNoPlaces);
  
          $("[id*=grdDemo] tbody").append(row);
          console.log(row);
          if (count == 1 || (count % 2 != 0)) {
            $(row).css("background-color", "rgb(193, 212, 248)");
          } else {
            $(row).css("background-color", "white");
          }
          count = count + 1;
          row = $("[id*=grdDemo] tr:last-child").clone(true);
  
        });
  
  
      },
      error: function() {
        console.log("Not Saved!");
      }
  
    });
  
  });
  </code></pre>