Trying to fire 'onclick' event on a containing div when a user clicks the Twitter "share" button. I'm using twitter's recommended implementation, which is a hyperlink and function. The function replaces HTML on the page and when it does, my 'onclick' won't fire.
<div id="shareTwitter" onclick='alert("onclick!");'>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="https://www.stackoverflow.com" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
Here's the fiddle: http://jsfiddle.net/tysonkoska/vxzqkL3h/
If you remark out the script, the 'alert' fires fine. Maybe there's a different/better way to to the integration?
Thanks...