Button Not Working on Mobile Devices But Works on Pc Bootstrap

Button not working on Mobile Devices but works on PC bootstrap

The issue may be that you're using the onClick event which won't register on a mobile device (as you don't click - you tap).

This answer explains how to use the "touchstart" event which will work on a mobile.

https://stackoverflow.com/a/22015946/2619909

html button not working in mobile device

Few observations :
- Not sure why have u added a div wrapper around the button. Try removing the div wrapper
- Your html mark up needs to be checked, since you are trying to view a html page on a mobile, if the elements are not structured properly, then there are high chances that one of the element be overlapping on the button. Hence the click event is not getting triggered for the button rather then it might be trying to trigger the click event of the overlapping element

Bootstrap Btn Classes Not Working on Mobile

Actually there are couple of mistakes in your code and expectation

  1. .btn-secondary class is not in the Bootstrap 3, You need to use Bootstrap v4 for that
  2. The button style which you have mentioned is of .btn-primary class not .btn-secondary class.

So replace the .btn-Secondary class to .btn-primary class,
then this code will work fine.

button, html input[type="button"], input[type="reset"], input[type="submit"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}


Related Topics



Leave a reply



Submit