In this activity you will add a dynamic counter that displays the number of characters entered into a <textarea> element.
- In
character-counter.js, create atextareavariable usingdocument.querySelector(). - Create a
countervariable for the paragraph that will hold the current character count oftextarea. - Using
Element.getAttribute()create alimitvariable that holds the max character limit defined by themaxlengthattribute of thetextareaelement. - Using
Element.addEventListener()and theinputevent, add an event handler totextareathat updatescounterevery time the user types a character.- Hint:
textarea.valuehas all the same methods as any other string.
- Hint: