如何通过javascript拨打电话号码而不使用< a>标签?
问题描述:
我设计了一个移动网页。在那里,我有一个电话号码字段,在点击时应该调用该特定号码。我不能使用:
I designed a mobile web page. There I have a phone number field, which on clicking should call that particular number. I can't use:
<a href="tel:+1800229933"></a>
因为我使用表格标签添加了电话号码字段,如下所示:
Because I have added the phone number field using table tag as follows:
<table><tr><td>Phone: 900 300 400</td></tr></table>
是否还有其他方法(如OnClick事件)在点击该列时调用该电话号码?
Is there any other methods(like OnClick event) to call that phone number on clicking that column?
答
更改此:
<table><tr><td>Phone: 900 300 400</td></tr></table>
to:
<table><tr><td><a href="tel:+900300400">Phone: 900 300 400</a></td></tr></table>