The code seems to working properly but I am not passing tests 4, 5, and 6. I would just like to pointed in the right direction of what could be going wrong. Thank you!
// running tests
4. When the #text-input element contains the text hello coder the #char-count element should contain the text "Character Count: 11/50"
5. When the character count is 50, the text should be displayed in red.
6. If character count is greater than or equal to 50, the user shouldn't be able to enter more characters.
// tests completed
So take the first issue and try to test by writing hello coder and seeing what the result is.
Does your code give 11 as described? If no, then check the lines of code that do the counting.
(debugging is just a series of small investigations. Do one at a time. If you need help for a specific thing you are debugging, please tell us how you tried to debug it and what you have found in your effort)
thank you! I was able to solve the 4 and 5. But I am still stuck on 6. When I test it I can’t type past 50 characters, this is currently the code I have for it. Is using “disabled” the wrong way to go or is it how I’m using it? Also I am un-sure of how to debug this step because it appears to be working fine.
if(textLength >= 50){
textArea.disabled = true
charCount.style.color = “red”
}
I just realized in the example app that you can backspace and erase the characters after you hit 50 characters. In my code you can’t do that, so that may have something to do with it, i don’t know how to fix that though.
looks like the problem is that I can paste into your input a large paragraph and it will display it but if you try to do that to the sample project, it cuts it off at 50
Yeah your right, and the number on the charCount doesn’t go up at all either. I’m trying .substring to help with it, do you feel that would fix that problem or is it something else?
let me know how it goes when you’ve tried as I haven’t done this new curriculum myself. (I did the archived one when it was the ‘current’ one at the time)
One thought would be, if the length is over 50, grab and display the first fifty and dump the rest and maybe which ever way you pick to do that will do the trick.