I have an <input type="number">
and I need the up and down spinner buttons for choosing the next value. Unfortunately, those spinner buttons are not visible on a mobile device. So, I want to create up and down buttons and display them only on mobile devices. The only thing I found, is a media query that displays a DOM element, when the screen size is small. But what, if the user simply decreases the browser window on a PC for some reason? This would display the spinner buttons as well as my up and down buttons.
Next thing I tested was
@media-desktop (min-width: 1px) {
.desk {
visibility: visible;
}
.div-only-mobile {
visibility: hidden;
}
}
but both divs are visible on PC and mobile device.
How can I display a DOM element on a mobile device and hide it on PC?
Many thanks.