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>
Are there any other methods(like OnClick event) to call that phone number on clicking that column?
Href=tel: creates the call link. This tells the browser how to use the number. “Tel: 123-456-7890 “creates the HTML phone number. The number within the quotes is the number it will call.
To use call we have to install react-native-phone-call package. This command will copy all the dependencies into your node_module directory. –save is optional, it is just to update the react-native-phone-call dependency in your package. json file.
You can simply add an onclick
handler to your <tr>
tag, then call window.open("tel:+1800229933");
.
Like so:
<table> <tr onclick="window.open('tel:900300400');"> <td>Phone: 900 300 400</td> </tr> </table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With