html5 - HTML 5 : Click to call by using tel in href for alternate numbers -


i implementing click call using href.

<a href="tel:+919876543210">click here call</a> 

it working single number. need give 2 numbers in href alternate number.

i have tried this,

<a href="tel:+919876543210, +919876543211">click here call</a> 

i tried following approach,

<a href="tel:+919876543210, tel:+919876543211">click here call</a> 

but takes first number. possible add 2 numbers in href? if yes how? when user click on random numbers should choosed. appreciated. in advance.

you can use javascript :-)

below code simple web page should solve problem

<!doctype html> <html lang="en">  <head>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="x-ua-compatible" content="ie=edge">     <title>document</title>     <script type="text/javascript">         // phone numbers         var phonenumbers = [             "+919876543210",             "+919876543211"         ];          /**          * returns random integer between min (inclusive) , max (inclusive)          * using math.round() give non-uniform distribution!          */         function getrandomint(min, max) {             return math.floor(math.random() * (max - min + 1)) + min;         }          function call() {             // min , max index of phone number array             min = 0;             max = phonenumbers.length - 1;              // random phone number             phonenumbertocall = phonenumbers[getrandomint(min, max)];              // call random number             window.open("tel:" + phonenumbertocall);          }     </script> </head> <body>     <a onclick="call()" href="">click here call</a> </body> </html> 

i got random number generator here => https://stackoverflow.com/a/1527820/2627137


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -