Build a Real Time Counter: can't pass the last test

I passed all the first 5 tests, but get stuck on the last one:
If character count is greater than or equal to 50 , the user shouldn’t be able to enter more characters.

I tried

  1. adding maxlength=50 to the textarea
  2. use javascript to set the textarea as readonly or disabled whenever the text length in the textarea reached 50 or above.

both of them failed. Is there ant other way to prevent the textarea from accepting more input?
IMHO, setting maxlength attribute on the textarea should be considered as a vaild answer.

can you share a link to the projet and your code?

Never mind. I figured it out. You need to reset the text inside the textarea to include just the first 50 characters.

Congrats, lapping! I stuck on 6th test too. Could you show the code with resetting? I don’t understand how to do it

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.