title: Textbox value in javascript
body: <p>I have this <code>textbox</code> that has the limit in <code>DB</code> for input 255. And I am trying to built a function in <code>JS</code> that stops the user for inserting more than 255 characters in that textbox. </p>
  
  <p>Here is the asp.net code:</p>
  
  <pre><code>&lt;asp:TextBox Id="textbox" TextMode="MultiLine"
               oninput="F(id,this.value.length, 255)"
               runat="server" Columns="25" Rows="5"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>And here is the code in <code>JS</code>(just a test):</p>
  
  <pre><code>this.textCounter = function (ref,value, maxlimit) {
      if (value &gt; maxlimit) {
          $('#textbox').value=" ";
      }
      return true;
  }
  </code></pre>
  
  <p>Somehow the <code>$('#textbox').value</code> is undefined.
  What I can do?</p>