Wednesday, 1 October 2014

jquery get value of input text field length

jquery get value of input text field length

Demo


jquery get value of input text field length

<input type="text" id="textbox"/>

<p>Error </p>
<button type="button" id="button">Click Me!</button>

============
$('#button').click(function() {
    var value = $('#textbox').val().length;
    
    if(value >=1)
    {
    alert(value);
         $("p").hide();
    }
    else{
    
        
    }
    
 
});
 



 

No comments:

Post a Comment