javascript - Can I send a Image to whatsApp using html hyperlink / a tag? - TagMerge
3Can I send a Image to whatsApp using html hyperlink / a tag?Can I send a Image to whatsApp using html hyperlink / a tag?

Can I send a Image to whatsApp using html hyperlink / a tag?

Asked 1 years ago
1
3 answers

U can't. The closest to it would be to send a link in the message that has a image preview, but that's not that usefull. I'm guessing this wouldn't even be possible to add in whatsapp because to access a user file like an image I believe this has to be done with a direct user interaction (like manually selecting the image), but not by clicking a link, just by doing that whatsapp can't get the image from user storage.

Source: link

0

I guess it would be like this if you are trying to create an image which acts like a link

<a href="https://web.whatsapp.com/send?text=Hello%20World!"><img src="myCoolImage.png" width="500" height="500"></a>

Source: link

0

The HTML <a> tag defines a hyperlink. It has the following syntax:
<a href="url">link text</a>
This example shows how to create a link to W3Schools.com:
<a href="https://www.w3schools.com/">Visit W3Schools.com!</a>
Use target="_blank" to open the linked document in a new browser window or tab:
<a href="https://www.w3schools.com/"
target="_blank">Visit W3Schools!</a>
Example
<h2>Absolute URLs</h2>

<a href="https://www.w3.org/">W3C</a>

<a href="https://www.google.com/">Google</a>

<h2>Relative URLs</h2>

<a href="html_images.asp">HTML Images</a>

<a href="/css/default.asp">CSS Tutorial</a>

Example
<a href="default.asp"><img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;"></a>

Source: link

Recent Questions on javascript

    Programming Languages