Answer the question
In order to leave comments, you need to log in
How to change the text-decoration to uppercase and back when the button is clicked?
I need to press the shift button (now it is empty), all the letters of the keyboard were changed to large and when pressed again, back to small.
Link to the code
And how can I make it so that when opening this chat, the scroll is always scrolled to the bottom?
Answer the question
In order to leave comments, you need to log in
Purely visual text-transform is fine, but the problem will arise when you need to insert letters from the keyboard into the message form when you click on them. Because this is just stylization, the letters themselves are still lowercase, and we need to issue capital letters to the form when the shift is pressed. There are two methods for this in JS .toLowerCase() and .toUpperCase()
The essence is the same as with styling, only we change the case not only visually, but also in the DOM
Example:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question