onclick
works fine on touchscreens; I’ve used it several times and have never had any problem.
You could consider using onmousedown
instead of onclick
. Or use jQuery to detect taps.
More Related Contents:
- 5 stars and the golden 5 stars are not together (When browsing with Internet explorer)
- How to hide css and js version details from weppalyzer in PHP
- How to make page loaders/animations/transitions
- Replacing css file on the fly (and apply the new style to the page)
- How to autosize a textarea using Prototype?
- Textarea Auto height [duplicate]
- How to change CSS property using JavaScript
- Relative Paths in Javascript in an external file
- Dynamically loading css stylesheet doesn’t work on IE
- How to silently hide “Image not found” icon when src source image is not found
- Setting CSS value limits of the window scrolling animation
- HTML – how can I show tooltip ONLY when ellipsis is activated
- HTML Table with vertical rows
- How to draw polygons on an HTML5 canvas?
- Using querySelectorAll to change the style property of multiple elements
- Convert TD columns into TR rows
- show loading icon until the page is load?
- How to use square cursor in a HTML input field?
- Adding a new line in a JSX string inside a paragraph – React
- CSS: Two column Div layout misaligns when Zoom changes
- Adding Google Translate to a web site
- Specify parent divs opacity but make it not affect children HTML elements
- How to override css prefers-color-scheme setting
- Enable/disable a button in pure javascript
- Styling Vuetify selectors
- How to get CSS class property in Javascript?
- How to keep elements non-refreshed
- How do you swap DIVs on mouseover (jQuery)?
- How to get a leaflet map canvas to have a 100% height?
- Can I save input from form to .txt in HTML, using JAVASCRIPT/jQuery, and then use it?