Tell us what’s happening:
Hi FCC staff,
Looks like the 6th (last) test has a bug. Although my solution works as expected, the last test does not pass, maybe because its checking for one specific solution instead multiple other possibilities.
Could please check this once?
Thanks
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Real Time Counter</title>
</head>
<body>
<textarea
rows="10"
cols="50"
id="text-input"
placeholder="Type something..."
></textarea>
<p id="char-count">Character Count: 0/50</p>
<script src="./script.js"></script>
</body>
</html>
/* file: script.js */
const charCount = document.getElementById("char-count");
const textInput = document.getElementById("text-input");
let count = 0;
textInput.addEventListener("input", (e) => {
console.log(e.target.value);
count = e.target.value.length;
charCount.innerText = `Character Count: ${count}/50`;
if (count === 50) {
charCount.style.color = "red";
textInput.setAttribute("maxLength", "50");
}
});
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Challenge Information:
Build a Real Time Counter - Build a Real Time Counter