Visual feedback when the button (bs5) is pressed

I would like to have clearly visible visual feedback when and during touching the buttons. When I release the button, the normal state should return after a short time.
Is this possible, and if so, how?

I don’t know of a feature like this in Bootstrap 5. Here are the docs.

Try,

button1.ontouchstart() {
 button1.style.backgroundColor="black";
}
button1.ontouchend() {
 button1.style.backgroundColor="red";
}

or,

button1.onmousedown() {
 button1.style.backgroundColor="black";
}
button1.onmouseup() {
 button1.style.backgroundColor="red";
}

or instead of setting the background colour toggle a classname.

It works fine, thank you.
only I use timerRef = SetTimeout(… for 100 ms and not ontouchend(…
So it is better to see.
My only problem is to find out, is the Android Device in Darcmode or not…
That will be better for the different colors.

I override dark mode with this css, so the background stays white and text stays black no matter if in dark mode or light mode.

/* Override dark mode */
html {
     background: white;
     color: black; 
}