Getting the length of a textbox value or content using JavaScript

后端 未结 1 818
一生所求
一生所求 2021-01-14 02:02

This is something that\'s driving me nuts:

I have this code and it works: I am trying to learn JavaScript before becoming addicted to JQuery. My sample project invol

相关标签:
1条回答
  • 2021-01-14 02:31

    May be it is just because of typo in length here:

    element.txtName.value.lenght;
    

    must be element.txtName.value.length;.

    If you want it to run every time user presses key , then look here: How to check string length with JavaScript

    0 讨论(0)
提交回复
热议问题