Currently, I am utilizing event.data
to capture the text inputted into this particular HTML textbox. My intention is to change the background color to red based on that input. However, when using the style attribute on event.data
, I encounter an error. It's important to note that I'm not relying on jQuery for this task.
textarea.addEventListener('input', function( event ) {
if( length > maxLength ) {
console.log(event.data);
}
// ...
}
I'm aiming for a solution similar to what is illustrated in this example.
Your assistance on this matter would be greatly appreciated.