Trigger phone call with Javascript

Jody Heavener picture Jody Heavener · May 28, 2013 · Viewed 20.6k times · Source

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?

Answer

Tom picture Tom · May 28, 2013

Use:

window.open('tel:12345');