Search code examples
javascripttel

Trigger phone call with Javascript


I would like to trigger a tel:12345 HREF using only Javascript, not with an anchor. I simply want to grab the value of an input field and use JS to prompt the user to call the number typed in. My trigger will be a button located next to the field.

Suggestions?


Solution

  • Use:

    window.open('tel:12345');