Skip to content
Advertisement

how to call a phone number through javascript without using tag?

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?

Advertisement

Answer

Change this:

<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>
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement