florida
05-23-2003, 04:21 PM
I am trying to count every occurences of a specific letter called "e" that is entered.
This just prints out the number 1 even though I have entered more occurences of the letter e.
Please advise:
function myfunction()
{
j = document.mypage.myfield.value;
ct = 0;
if(/e/.test(j))
{
ct++;
}
alert(ct);
}
This just prints out the number 1 even though I have entered more occurences of the letter e.
Please advise:
function myfunction()
{
j = document.mypage.myfield.value;
ct = 0;
if(/e/.test(j))
{
ct++;
}
alert(ct);
}