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
Post a Comment