K
K
kaidos2021-07-22 09:09:37
css
kaidos, 2021-07-22 09:09:37

How to change the text-decoration to uppercase and back when the button is clicked?

y4hZ3jLTVEo.jpg?size=1920x1080&quality=96&sign=243fa43e3156f873e8bb5baa58efec99&type=album

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

2 answer(s)
A
Aleksandr Kritskii, 2021-07-22
@kaidos

A
Alexander Shemakhanov, 2021-07-22
@sh3mahan

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 question

Ask a Question

731 491 924 answers to any question