javascript - length of textbox contents returning only 1 when it should be more -


i have textbox check in jquery see if length less 11 chars long. in testing, 've entered ten chars length method returns one.

this text box:

<input type="text" id="txtmytext" name="mytext" value="testing" onblur = "chkinput()"/> 

my function chkinput called when exit box wasn't working expected. inserted alert length attribute:

alert("text " + $("#txtmytext").length); 

the alert shows length = 1.

you want length of text of textarea element:

alert('text ' + $('#txtmytext').val().length); 

Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -