Specify maxlength in css vis jQuery - Javascript jQuery

Javascript examples for jQuery:CSS

Description

Specify maxlength in css vis jQuery

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script> 
      <style id="compiled-css" type="text/css">

input {// ww  w.j a  v  a2s .com
   width:100px
}


      </style> 
      <script type="text/javascript">
    $(window).load(function(){
$("input").attr("maxlength", 4)
    });

      </script> 
   </head> 
   <body> 
      <input text="text" size="100">  
   </body>
</html>

Related Tutorials