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

前端 未结 5 726
挽巷
挽巷 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:28

    If you want to do it through html, then you just have to place a tag like this:

    Call me!
    

    similarly if you wanna do it through javascript, you can do:

    document.location.href = "tel:XXXXXXXXXX";
    

提交回复
热议问题