Is it possible to programmatically call a telephone number in JS?

前端 未结 5 723
挽巷
挽巷 2021-02-08 06:53

So basically right now I can create a button with an A tag that has an href=\"tel:XXXXXXXXXXX\" and if a user clicks / taps on that it will bring them into their phone applicati

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-08 07:26

    You can try with below one,

    window.location.href = "tel:+91123456789";
    

    But, for IOS it may not work because of some permission issues. In that case you can try like below,

    window.open('tel:+91123456789', '_system');
    

提交回复
热议问题