href = tel: It works intermittently

2

Good day, I have the following piece of code in the index of my page:

  <div class="col-sm-3 claseHome">
    <button class="btn btn-primary">
      <a href="tel:11111111"><span class="glyphicon glyphicon-earphone">
       </span>111-1111</a>
     </button>
    <div class="col-lg-12 text-center"><a href="foto.pdf" 
     target="_blank"><img src="img/foto.jpg" class="img-responsive"></a>
       <a class="nota" href="anterior.php"><strong>HOLA</strong></a>
    </div>
  </div>

And my problem is that, when I open the page on my cell phone, so that the call button works (that is, to redirect me to the phone with that number), I have to click several times. Sometimes it works well, sometimes it does not respond until the fifth or sixth time I touch it. Could you help me? Thanks!

I have tried several cell phones with different operating systems and different versions and it happens the same in all.

    
asked by Maria Emilia 21.03.2018 в 16:07
source

1 answer

3

The problem is that you are using a button

You should use a link tag <a> in order for the phone to understand that you must take an action

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>

<a class="btn btn-primary" href="tel:11111111"><i class="glyphicon glyphicon-earphone"> </i>111-1111</a>
    
answered by 21.03.2018 / 16:14
source