Question: Not sure to post here or webmasters, I apologize if I got wrong.

Does anyone know of a way to execute a short code on a image click?

I can not find anything on how to do this

Edit: My apologizes

Yes Shortcode means wordpress shortcode

Answer: 
==== Template page ====

```
<script> 
function executeShortCode() {
   var url="<?php echo get_template_directory_uri(); ?>/yourAjaxPage.php";
   jQuery.post(url,function(data){
   console.log(data);
   });

}
</script>

```

==== Ajax page ====

```
//yourAjaxPage.php
<?php echo do_shortcode('[yourshortcode]'); ?>

```
Get image element by it's id and attach the handler at `onclick` event something like

**html**

```
<img id="myImg" src="" />

```

**JS**

```
<script>
 document.getElementById('myImg').onclick = function (){
     //execute your short code here.
  }
</script>

```