Change max length for Input Value - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form Event


Change max length for Input Value

Demo Code

ResultView the demo in separate window

      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){/*from   w  ww.  j  a  va2  s  . c o  m*/
document.getElementById('chat-input-field').maxLength = 300

      <input id="chat-input-field" value="" placeholder="Click here to join the conversation" maxlength="256" type="text">  

Related Tutorials