title: Setting maxlength of textbox with JavaScript or jQuery
body: <p>I want to change the maxlength of a textbox with JavaScript or jQuery:  I tried the following but it didn't seem to help:</p>
  
  <pre><code>var a = document.getElementsByTagName('input');
  for(var i=0; i&lt;a.length; i++) {
      if((a[i].type!= 'radio')||(a[i].type!= 'checkbox'))
          a[i].maxlength = 5;
  }
  document.getElementsByTagName('input')[1].maxlength="3";
  
  $().ready(function()
  {
      $("#inputID").maxlength(6);
  });
  </code></pre>
  
  <p>What am I doing wrong?</p>