Only replacing the text with an image is not going to work, because the embedded script looks for the href attribute of the clicked element (event.target). In the case of an image inside a link tag, the target element is the image, and does not have an href attribute.
To solve that, you can catch the event on any image that is inside these links, block it, and simulate a click on the parent link.
Demo not using jQuery
var sh_lead_images = document.querySelectorAll('.sh_lead_button img');
for(var i=0; i<sh_lead_images.length; i++)
{
sh_lead_images[i].addEventListener('click', function(e){
e.stopPropagation();
e.preventDefault();
this.parentNode.click();
});
}
<a class="sh_lead_button" href="https://107617.17hats.com/p#/lcf/sfrnrskrvhcncwvnrtwwvhxvzkrvzhsd" onclick="shLeadFormPopup.openForm(event)">
<img src="http://www.truthunity.net/sites/all/content/graphics/ministry-click-me-button.jpg" alt="">
</a>
<script type="text/javascript" src="https://107617.17hats.com/embed/lead/script/sfrnrskrvhcncwvnrtwwvhxvzkrvzhsd"></script>
Demo using jQuery
$('.sh_lead_button img').click(function(e){
e.stopPropagation();
e.preventDefault();
$(this).parent().click();
});
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<a class="sh_lead_button" href="https://107617.17hats.com/p#/lcf/sfrnrskrvhcncwvnrtwwvhxvzkrvzhsd" onclick="shLeadFormPopup.openForm(event)">
<img src="http://www.truthunity.net/sites/all/content/graphics/ministry-click-me-button.jpg" alt="">
</a>
<script type="text/javascript" src="https://107617.17hats.com/embed/lead/script/sfrnrskrvhcncwvnrtwwvhxvzkrvzhsd"></script>
<a><img></a>. If it's generated by a script you'd have to modify the script. It's not clear what thetypeattribute of thescriptelement has to do with your question, if at all.several different thingsyou've tried?<a class="sh_lead_button" href="https://107617.17hats.com/p#/lcf/ccdhppwcbfbkhndfgtrvsdrgtkxwfvnx" onclick="shLeadFormPopup.openForm(event)"> <img src="http://www.harmonyrescue.com/wp-content/uploads/2016/04/Opt_in_Ribbon_Challenges.png" ></a><script type="text/javascript" src="https://107617.17hats.com/embed/lead/script/ccdhppwcbfbkhndfgtrvsdrgtkxwfvnx"></script>It does show the image, but the on_click doesn't appear to work.