Search code examples
javascripthtmlform-submiturl-link

How to make a submit out of a <a href...>...</a> link?


I got an image with which links to another page using <a href="..."> <img ...> </a>.

How can I make it make a post like if it was a button <input type="submit"...>?


Solution

  • <input type="image" name="your_image_name" src="your_image_url.png" />
    

    This will send the your_image_name.x and your_image_name.y values as it submits the form, which are the x and y coordinates of the position the user clicked the image.