onClick - call phone number [duplicate]

被刻印的时光 ゝ 提交于 2019-12-11 18:53:05

问题


Possible Duplicate:
URL Scheme for Phone Call
iphone safari making phone call

I am using the code below on a mobile site but when somebody clicks I don't want them directed to a new page I want a phone number to be called. Is this possible using the onClick function?

<div class="button left" id="map" onClick="window.location='#'"><span class="bottom">Call us now</span></div>

回答1:


You should rather use something like

<a href="tel:[phone number]"><span class="bottom">Call us now</span></a>


来源:https://stackoverflow.com/questions/11032489/onclick-call-phone-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!