Ok, we are getting closer all the time
You have the following line of code:
Unfortunately this line does not give tell the Javascript interpreter what it should do with the result of adding "total + 1". That is, "total + 1" will give us a value, but that value is not assigned to anything.
Your previous version of the code had
which
is assigning the value created by the "total + 1" back into "total".
So try putting
that section only of the code back to the way it was. Keep your new
if (letter=='a') statement, just change what happens when that conditional is true.
Regards, Andrew
P.S. Do you realize that this code can only handle a single character being entered at a time? That is, if you enter "astrology" it will not match "a", likewise entering "zoo" wont match "z" (so you wont exit).