I have tried all the solutions listed in the following link: jQuery/HTML - Disable OnClick but none of them work for me.
I am trying to stop an onclick event from an external .js from firing. The .js is here http://x.instagramfollowbutton.com/follow.js - it can be unminified at http://unminify.com/
The script is included on my site with the following:
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src="//x.instagramfollowbutton.com/follow.js";s.parentNode.insertBefore(g,s);}(document,"script"));
The resulting HTML code is:
<span class="ig-follow" data-id="*deleted*" data-handle="*deleted*" data-count="true" data-size="small" data-username="false"><div title="Follow @*deleted* on Instagram" class="IGF small"><div class="ig-background"><img class="ig-camera" src="//x.instagramfollowbutton.com/components/instagram/v2/img/ig-camera.png" height="16" width="16"><span class="ig-text">Follow</span></div><div class="ig-count" id="c"><i></i><u></u><a>217</a></div></div></span>
How can I stop the external script's onclick event from firing?
Again, I have tried all the solutions listed in the following link: jQuery/HTML - Disable OnClick but none of them work for me.
.ig-follow { pointer-events: none; }would be enough then on modern browser, otherwise check which element is bound click handler and remove it. But that's not clear exactly why you are trying to do. Bind your own event or just remove all click ones making button useless? A simple example replicating your issue would certainly help