Change max length for Input Value - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Form Event

Description

Change max length for Input Value

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <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
    }

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

Related Tutorials